API reference › @evolu/sqlite-wasm › c-api › sqlite3_rollback_hook

function sqlite3_rollback_hook(
  deps: SqliteWasmDep,
): (
  db: SqliteDbPtr,
  xCallback: 0 | SqliteFunctionPtr,
  pArg: 0 | WasmPtr,
) => 0 | WasmPtr;

Defined in: packages/sqlite-wasm/src/CApi.ts:1741

Registers the callback SQLite calls with pArg whenever a transaction rolls back, except when closing the connection, replacing the previous one; NULL removes it. Returns the previous pArg or NULL; the callback must not use the connection, not even to prepare or step a statement.

Wasm type i(iii). Signature ["sqlite3_rollback_hook", "void*", "sqlite3*", "funcptr:v(p)", "*"] from SQLite's table.

See https://sqlite.org/c3ref/commit_hook.html.