[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\_commit\_hook

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

Defined in: [packages/sqlite-wasm/src/CApi.ts:1725](https://github.com/evoluhq/evolu/blob/bc4578a260dd15d5bbf94b83765ca05984d194cb/packages/sqlite-wasm/src/CApi.ts#L1725)

Sets the connection's commit callback, replacing the previous one, or removes
it for NULL, and returns the previous call's pArg, NULL for the first call.
SQLite calls it with pArg before each commit and turns the commit into a
rollback when it returns non-zero; it must not modify the connection.

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

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