From 3de49203855faa8563bd24ea54c778b7949fe891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 6 Aug 2016 14:54:53 +0200 Subject: [PATCH] SQLTableBuilder documentation --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 77502d1ad..08bb82b23 100644 --- a/README.md +++ b/README.md @@ -2116,6 +2116,7 @@ For an efficient algorithm which synchronizes the content of a database table wi **The query interface lets you write pure Swift instead of SQL:** ```swift +try db.create(table: "wines") { t in ... } let count = Wine.filter(color == Color.Red).fetchCount(db) let wines = Wine.filter(origin == "Burgundy").order(price).fetchAll(db) ``` @@ -2123,6 +2124,7 @@ let wines = Wine.filter(origin == "Burgundy").order(price).fetchAll(db) Please bear in mind that the query interface can not generate all possible SQL queries. You may also *prefer* writing SQL, and this is just OK. From little snippets to full queries, your SQL skills are welcome: ```swift +try db.execute("CREATE TABLE wines (...)") let count = Wine.filter(sql: "color = ?", arguments: [Color.Red]).fetchCount(db) let wines = Wine.fetchAll(db, "SELECT * FROM wines WHERE origin = ? ORDER BY price", arguments: ["Burgundy"]) ```