README.md

This commit is contained in:
Gwendal Roué committed 2016-01-30 15:33:22 +01:00
1 parent f0b80c72a5
commit cdf960ff66
1 file changed
+5 -1
+5 -1
View File
@@ -2070,7 +2070,11 @@ dbQueue.inDatabase { db in
For example:
```swift
let persons = Person.fetchAll(db) // [Persons]
for person in Person.filter(Col.name != nil).fetch(db) {
print(person)
}
let allPersons = Person.fetchAll(db) // [Person]
let arthur = Person.filter(Col.name == "Arthur").fetchOne(db) // Person?
```
Both `fetch` and `fetchAll` let you iterate the full list of fetched objects. The differences are: