README.md

This commit is contained in:
Gwendal Roué committed 2016-05-02 08:28:00 +02:00
1 parent 3d1ecc1881
commit dc011d522f
1 file changed
+14 -2
+14 -2
View File
@@ -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)
}