From dc011d522f52e009087b2d600c9c009ef62fae3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 2 May 2016 08:28:00 +0200 Subject: [PATCH] README.md --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 38b8a8233..34c163e5f 100644 --- a/README.md +++ b/README.md @@ -261,7 +261,13 @@ try dbQueue.inTransaction { db in return .Commit } -// Extract values from the database: +// Read values: +dbQueue.inDatabase { db in + let pois = PointOfInterest.fetchAll(db) + let poiCount = PointOfInterest.fetchCount(db) +} + +// Extract a value from the database: let poiCount = dbQueue.inDatabase { db in PointOfInterest.fetchCount(db) } @@ -325,7 +331,13 @@ try dbPool.writeInTransaction { db in return .Commit } -// Extract values from the database: +// Read values: +dbPool.read { db in + let pois = PointOfInterest.fetchAll(db) + let poiCount = PointOfInterest.fetchCount(db) +} + +// Extract a value from the database: let poiCount = dbPool.read { db in PointOfInterest.fetchCount(db) }