From 5f6bdc3ff5650a26dea9f8a49bc73af1005cd53c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 1 Jul 2015 13:53:23 +0200 Subject: [PATCH] README.md --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 91f8df042..81f07645e 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,20 @@ let dbQueue = try DatabaseQueue(path: "/tmp/GRDB.sqlite") try dbQueue.inTransaction { db -> Void in try db.execute("DROP TABLE IF EXISTS persons") + try db.execute( "CREATE TABLE persons (" + "id INTEGER PRIMARY KEY, " + "name TEXT, " + "age INT)") - try db.execute("INSERT INTO persons (name, age) VALUES (?, ?)", bindings: ["Arthur", 36]) - try db.execute("INSERT INTO persons (name, age) VALUES (:name, :age)", bindings: [":name": "Barbara", ":age": 37]) + + try db.execute( + "INSERT INTO persons (name, age) VALUES (?, ?)", + bindings: ["Arthur", 36]) + + try db.execute( + "INSERT INTO persons (name, age) VALUES (:name, :age)", + bindings: [":name": "Barbara", ":age": 37]) } try dbQueue.inDatabase { db -> Void in