From d3ee18fe713be063524fe83d420a62ecff8d060b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 10 Dec 2015 16:19:26 +0100 Subject: [PATCH] README.md --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0c65ff060..b3dd1da17 100644 --- a/README.md +++ b/README.md @@ -1459,7 +1459,7 @@ Citizenship.fetchOne(db, key: ["personId": 1, "countryIsoCode": "FR"]) **The `DatabasePersistable` protocol grants adopting types with CRUD methods.** -It has only two mandatory methods: +It has two mandatory methods: ```swift public protocol DatabasePersistable : DatabaseTableMapping { @@ -1511,10 +1511,12 @@ extension Person { } } -var person = Person(id: nil, name: "Arthur") -person.id // nil -try person.save(db) -person.id // some value +dbQueue.inDatabase { db in + var person = Person(id: nil, name: "Arthur") + person.id // nil + try person.save(db) + person.id // some value +} ```