From 82f26b85bcff40e141c1c52effc9f484ce74c629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 6 Oct 2015 13:36:17 +0200 Subject: [PATCH] Record documentation --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0b7c8cb78..16f34b5cf 100644 --- a/README.md +++ b/README.md @@ -1191,12 +1191,15 @@ Yet, it does a few things well: (person.name, person.citizenshipsCount) ``` -- **It provides the classic CRUD operations.** Primary keys can be an automatically generated RowID, or a multi-column primary key. +- **It provides the classic CRUD operations.** ```swift - let person = Person(name: "Arthur") // RowID primary key - let country = Country(isoCode: "FR", name: "France") // String primary key - let citizenship = Citizenship(personId: person.id, countryIsoCode: country.isoCode) // Multiple columns primary key + // RowID primary key + let person = Person(name: "Arthur") + // String primary key + let country = Country(isoCode: "FR", name: "France") + // Multiple columns primary key + let citizenship = Citizenship(personId: person.id, countryIsoCode: country.isoCode) try person.insert(db) // Automatically fills person.id person.name = "Barbara" @@ -1215,7 +1218,7 @@ Yet, it does a few things well: person = Person.fetch... person.name = "Barbara" person.age = 41 - person.databaseChanges.keys // ["name"] + person.databaseChanges.keys // ["age"] if person.databaseEdited { try person.save(db) }