pub fn execute(sql: &str) -> i32Expand description
Run an INSERT, UPDATE, or DELETE statement.
Returns the number of affected rows, or -1 on error.
ⓘ
let affected = db::execute("UPDATE orders SET status = 'shipped' WHERE id = 'abc'");
log::info(&format!("Updated {} rows", affected));