[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\_exec

```ts
function sqlite3_exec(
  deps: SqliteWasmDep,
): (
  db: SqliteDbPtr,
  sql: 0 | CStringPtr,
  callback: 0 | SqliteFunctionPtr,
  pArg: 0 | WasmPtr,
  errmsg: 0 | WasmPtr,
) => SqliteResultCode;
```

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

Runs zero or more semicolon-separated UTF-8 SQL statements, stopping at the
first error, and calls the callback, unless NULL, with pArg for each result
row; a non-zero callback result stops with SQLITE_ABORT. Unless errmsg is
NULL, it receives NULL on success or an error message the caller frees with
[sqlite3\_free](https://evolu.dev/docs/api-reference/sqlite-wasm/c-api/functions/sqlite3_free).

Wasm type `i(iiiii)`. Signature `["sqlite3_exec", "int", "sqlite3*",
"string:flexible", "funcptr:i(pipp)", "*", "**"]` from SQLite's table.

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