From 2e4dec741a0382d05773b47bbc031c6c309804a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 11 Mar 2016 17:24:08 +0100 Subject: [PATCH] Documentation --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b7c426d25..d3c9c93a0 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ try dbQueue.inDatabase { db in } ``` -Fetch database rows and values: +Fetch [database rows](#row-queries) and [values](#value-queries): ```swift for row in Row.fetchAll(dbQueue, "SELECT * FROM pointOfInterests") { @@ -74,12 +74,13 @@ struct PointOfInterest { // snip: turn PointOfInterest into a "record" by adopting the protocols that // provide fetching and persistence methods. +var berlin = PointOfInterest( + id: nil, + title: "Berlin", + favorite: false, + coordinate: CLLocationCoordinate2DMake(52.52437, 13.41053)) + try dbQueue.inDatabase { db in - var berlin = PointOfInterest( - id: nil, - title: "Berlin", - favorite: false, - coordinate: CLLocationCoordinate2DMake(52.52437, 13.41053)) try berlin.insert(db) print(berlin.id) // some value