milestone 20: declarative configuration for iac
This commit is contained in:
@@ -88,6 +88,18 @@ pub fn putSetting(database: *db.Db, key: []const u8, value: []const u8) db.Error
|
||||
try stmt.exec();
|
||||
}
|
||||
|
||||
/// Removes one key. Silent about a key that is not stored: the reconcile
|
||||
/// engine's sweep computes the set of keys to drop from a list it has already
|
||||
/// read, so "no such row" is not a caller error the way it is for a by-id
|
||||
/// mutation, and `execStrict` would turn a harmless race into a failed
|
||||
/// transaction.
|
||||
pub fn deleteSetting(database: *db.Db, key: []const u8) db.Error!void {
|
||||
var stmt = try database.prepare("DELETE FROM settings WHERE key = ?1");
|
||||
defer stmt.deinit();
|
||||
try stmt.bindText(1, key);
|
||||
return stmt.exec();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// tests
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user