Documentation

This commit is contained in:
Gwendal Roué committed 2021-03-18 19:25:07 +01:00
1 parent 529b042b8a
commit c47316a846
1 file changed
+4 -6
+4 -6
View File
@@ -1741,14 +1741,12 @@ updateStatement.arguments = ["name": "Arthur", "score": 1000]
selectStatement.arguments = ["Arthur"]
```
Alternatively, you can create a statement with an [SQLLiteral] in which can safely embed raw values without any risk of syntax errors or SQL injection:
Alternatively, you can create a prepared statement with [SQL Interpolation]:
```swift
let name = "O'Brien"
let score = 1000
let updateStatement = try db.makeUpdateStatement(literal: """
INSERT INTO player (name, score) VALUES (\(name), \(score))
""")
let updateStatement = try db.makeUpdateStatement(literal: "...")
let selectStatement = try db.makeSelectStatement(literal: "...")
// ~~~~~~~
```
Update statements can be executed: