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
fa73baea9e
commit
f4d8570b9c
1 file changed
+3
-3
@@ -507,15 +507,15 @@ There are many supported value types (Bool, Int, String, NSDate, Swift enums, et
|
||||
```swift
|
||||
dbQueue.inDatabase { db in
|
||||
// The number of persons with an email ending in @example.com:
|
||||
let count = Int.fetchOne(db,
|
||||
let count: Int = Int.fetchOne(db,
|
||||
"SELECT COUNT(*) FROM persons WHERE email LIKE ?",
|
||||
arguments: ["%@example.com"])!
|
||||
|
||||
// All URLs:
|
||||
let urls = NSURL.fetchAll(db, "SELECT url FROM links")
|
||||
let urls: [NSURL] = NSURL.fetchAll(db, "SELECT url FROM links")
|
||||
|
||||
// The emails of people who own at least two pets:
|
||||
let emails = Optional<String>.fetchAll(db,
|
||||
let emails: [String?] = String?.fetchAll(db,
|
||||
"SELECT persons.email " +
|
||||
"FROM persons " +
|
||||
"JOIN pets ON pets.masterId = persons.id " +
|
||||
|
||||
Reference in new issue
Block a user