From 228c36d164ff12ede0919ac42995f8f4a2c3a86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 11 Mar 2016 14:02:57 +0100 Subject: [PATCH] Documentation --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 313c291cd..09ab4aabe 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,8 @@ for row in Row.fetchAll(dbQueue, "SELECT * FROM pointOfInterests") { print(title, favorite, coordinate) } -let poiCount = Int.fetchOne(dbQueue, "SELECT COUNT(*) FROM pointOfInterests")! -let poiTitles = String.fetchAll(dbQueue, "SELECT title FROM pointOfInterests") +let poiCount = Int.fetchOne(dbQueue, "SELECT COUNT(*) FROM pointOfInterests")! // Int +let poiTitles = String.fetchAll(dbQueue, "SELECT title FROM pointOfInterests") // [String] ``` Insert and fetch [Records](#records): @@ -88,7 +88,7 @@ try dbQueue.inDatabase { db in } // Fetch from SQL -let pois = PointOfInterest.fetchAll(dbQueue, "SELECT * FROM pointOfInterests") +let pois = PointOfInterest.fetchAll(dbQueue, "SELECT * FROM pointOfInterests") // [PointOfInterest] ``` Avoid SQL with the [query interface](#the-query-interface): @@ -97,11 +97,11 @@ Avoid SQL with the [query interface](#the-query-interface): let title = SQLColumn("title") let favorite = SQLColumn("favorite") -let paris = PointOfInterest.fetchOne(dbQueue, key: 1) -let berlin = PointOfInterest.filter(title == "Berlin").fetchOne(dbQueue) +let paris = PointOfInterest.fetchOne(dbQueue, key: 1) // PointOfInterest? +let berlin = PointOfInterest.filter(title == "Berlin").fetchOne(dbQueue) // PointOfInterest? let request = PointOfInterest.filter(favorite).order(title) -let favoritePois = request.fetchAll(dbQueue) -let favoritePoiCount = request.fetchCount(dbQueue) +let favoritePois = request.fetchAll(dbQueue) // [PointOfInterest] +let favoritePoiCount = request.fetchCount(dbQueue) // Int ```