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
3eb6cc205b
commit
40c5004c03
1 file changed
+4
@@ -296,6 +296,8 @@ SQLite supports **Prepared Statements** that can be reused. For example:
|
||||
```swift
|
||||
try dbQueue.inTransaction { db in
|
||||
|
||||
// Update statement
|
||||
|
||||
let statement = try db.updateStatement("INSERT INTO persons (name, age) VALUES (:name, :age)")
|
||||
|
||||
let persons = [
|
||||
@@ -312,6 +314,8 @@ try dbQueue.inTransaction { db in
|
||||
|
||||
dbQueue.inDatabase { db in
|
||||
|
||||
// Select statement
|
||||
|
||||
let statement = try db.selectStatement("SELECT COUNT(*) FROM persons " +
|
||||
"WHERE age < ?")
|
||||
|
||||
|
||||
Reference in new issue
Block a user