mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-30 04:28:44 +00:00
Documentation
This commit is contained in:
1 parent
e111529035
commit
3c4ff587ca
1 file changed
+5
-4
@@ -1845,10 +1845,11 @@ let persons = try Person.fetchAll(db, "SELECT ...", arguments: ...) // [Person]
|
||||
Add the [TableMapping](#tablemapping-protocol) protocol and you can stop writing SQL:
|
||||
|
||||
```swift
|
||||
let persons = try Person.filter(emailColumn != nil).order(nameColumn).fetchAll(db) // [Person]
|
||||
let person = try Person.fetchOne(db, key: 1) // Person?
|
||||
let person = try Person.fetchOne(db, key: ["email": "arthur@example.com"]) // Person?
|
||||
let countries = try Country.fetchAll(db, keys: ["FR", "US"]) // [Country]
|
||||
let spain = try Country.fetchOne(db, key: "ES") // Country?
|
||||
let persons = try Person // [Person]
|
||||
.filter(Column("email") != nil)
|
||||
.order(Column("name"))
|
||||
.fetchAll(db)
|
||||
```
|
||||
|
||||
See [fetching methods](#fetching-methods), and the [query interface](#the-query-interface).
|
||||
|
||||
Reference in new issue
Block a user