mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-28 04:24:20 +00:00
README.md
This commit is contained in:
1 parent
be4104c5cf
commit
042c0509d6
1 file changed
+2
-2
@@ -1975,7 +1975,7 @@ dbQueue.inDatabase { db in
|
||||
For example:
|
||||
|
||||
```swift
|
||||
let persons = Person.order(name).fetchAll(db) // [Persons]
|
||||
let persons = Person.all().fetchAll(db) // [Persons]
|
||||
```
|
||||
|
||||
Both `fetch` and `fetchAll` let you iterate the full list of fetched objects. The differences are:
|
||||
@@ -2061,7 +2061,7 @@ You can also fetch other aggregated values (average, sum, min, max, etc.) For ex
|
||||
|
||||
```swift
|
||||
dbQueue.inDatabase { db in
|
||||
// SELECT MIN("age") FROM "persons" WHERE email IS NOT NULL
|
||||
// SELECT MIN("age") FROM "persons"
|
||||
let request = Person.select(min(Col.age))
|
||||
let minAge = Int.fetchOne(db, request) // Int?
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user