UpdateStatement
public final class UpdateStatement : Statement
A subclass of Statement that executes SQL queries.
You create UpdateStatement with the Database.makeUpdateStatement() method:
try dbQueue.inTransaction { db in
let statement = try db.makeUpdateStatement(sql: "INSERT INTO player (name) VALUES (?)")
try statement.execute(arguments: ["Arthur"])
try statement.execute(arguments: ["Barbara"])
return .commit
}
-
Executes the SQL query.
Throws
A DatabaseError whenever an SQLite error occurs.Declaration
Swift
public func execute(arguments: StatementArguments? = nil) throws
Parameters
arguments
Optional statement arguments.