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

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

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.

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.