From 6b11f02ec6fa8f660d8bf51b20691401694befe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 6 Jul 2015 10:57:32 +0200 Subject: [PATCH] README.md --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 17848b2cd..0bf7e3340 100644 --- a/README.md +++ b/README.md @@ -24,21 +24,19 @@ import GRDB // Open database connection let dbQueue = try DatabaseQueue(path: "/path/to/database.sqlite") -// Fetch and insert values: -let redWinesCount = dbQueue.inDatabase { db in // Int +let redWinesCount = dbQueue.inDatabase { db in // Int db.fetchOne(Int.self, "SELECT COUNT(*) FROM wines WHERE color = ?", bindings: [Color.Red])! } -// Insert and fetch row models: try dbQueue.inTransaction { db in try Person(name: "Arthur").insert(db) return .Commit } dbQueue.inDatabase { db in - let persons = db.fetchAll(Person.type, "SELECT ...") // [Person] - for wine in db.fetch(Wine.type, "SELECT ...") { // AnySequence + let persons = db.fetchAll(Person.type, "SELECT ...") // [Person] + for wine in db.fetch(Wine.type, "SELECT ...") { // AnySequence ... } }