From fb829423e7e8f4f64b032d1697f7ad919d48d80d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 12 Jan 2016 09:17:40 +0100 Subject: [PATCH] README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b1193b927..f3b9e8094 100644 --- a/README.md +++ b/README.md @@ -1542,7 +1542,7 @@ Yet, here is the rule: - If your type is a struct that mutates on insertion, choose `MutableDatabasePersistable`. For example, if your table has an INTEGER PRIMARY KEY, you want to store the inserted id on successful insertion. - Otherwise, stick with `DatabasePersistable`. -For example, the Country struct below has no INTEGER PRIMARY KEY, and is not mutated on insertion. On the other side, the Person struct is interested in its rowID, and mutates itself on insertion: +For example, the Country struct below has no INTEGER PRIMARY KEY, and is not mutated on insertion: ```swift // CREATE TABLE countries ( @@ -1565,7 +1565,11 @@ struct Country : DatabasePersistable { // Declare the country as `let`, since its insertion does not mutate it: let country = Country(isoCode: "FR", name: "France") try country.insert(db) +``` +On the other side, the Person struct is interested in its rowID, and mutates itself on insertion: + +```swift // CREATE TABLE persons ( // id INTEGER PRIMARY KEY, // name TEXT