milestone 20: declarative configuration for iac
This commit is contained in:
@@ -57,6 +57,7 @@ pub const c = struct {
|
||||
pub extern fn sqlite3_column_bytes(stmt: *c.Stmt, col: c_int) c_int;
|
||||
pub extern fn sqlite3_last_insert_rowid(db: *Sqlite3) i64;
|
||||
pub extern fn sqlite3_changes(db: *Sqlite3) c_int;
|
||||
pub extern fn sqlite3_total_changes(db: *Sqlite3) c_int;
|
||||
};
|
||||
|
||||
/// Result codes, from the vendored `sqlite3.h` (3.53.4).
|
||||
@@ -429,6 +430,15 @@ pub const Db = struct {
|
||||
pub fn changes(self: *Db) i64 {
|
||||
return c.sqlite3_changes(self.handle);
|
||||
}
|
||||
|
||||
/// Every row this connection has inserted, updated or deleted since it was
|
||||
/// opened. Monotonic, so a caller proves "this call wrote nothing" by
|
||||
/// reading it either side and comparing — which is stronger than comparing
|
||||
/// content, because an UPDATE that rewrites identical values still moves
|
||||
/// this counter.
|
||||
pub fn totalChanges(self: *Db) i64 {
|
||||
return c.sqlite3_total_changes(self.handle);
|
||||
}
|
||||
};
|
||||
|
||||
fn openHandle(filename: [:0]const u8, flags: c_int) Error!*c.Sqlite3 {
|
||||
|
||||
Reference in New Issue
Block a user