mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
README.md
This commit is contained in:
1 parent
f0b80c72a5
commit
cdf960ff66
1 file changed
+5
-1
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user