[API reference](https://evolu.dev/docs/api-reference) › [@evolu/sqlite-wasm](https://evolu.dev/docs/api-reference/sqlite-wasm) › [c-api](https://evolu.dev/docs/api-reference/sqlite-wasm/c-api) › sqlite3\_rollback\_hook

```ts
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](https://github.com/evoluhq/evolu/blob/bc4578a260dd15d5bbf94b83765ca05984d194cb/packages/sqlite-wasm/src/CApi.ts#L1741)

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.