mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
30 lines
811 B
Swift
30 lines
811 B
Swift
//
|
|
// UpdateStatement.swift
|
|
// GRDB
|
|
//
|
|
// Created by Gwendal Roué on 30/06/2015.
|
|
// Copyright © 2015 Gwendal Roué. All rights reserved.
|
|
//
|
|
|
|
public final class UpdateStatement : Statement {
|
|
|
|
// TODO: document this reset
|
|
public func execute(bindings bindings: Bindings? = nil) throws {
|
|
if let bindings = bindings {
|
|
self.bindings = bindings
|
|
}
|
|
reset()
|
|
if let trace = database.configuration.trace {
|
|
trace(sql)
|
|
}
|
|
let code = sqlite3_step(sqliteStatement)
|
|
switch code {
|
|
case SQLITE_DONE:
|
|
// the statement has finished executing successfully
|
|
break
|
|
default:
|
|
try SQLiteError.checkCResultCode(code, sqliteConnection: database.sqliteConnection, sql: sql)
|
|
}
|
|
}
|
|
}
|