[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\_prepare\_v3

```ts
function sqlite3_prepare_v3(
  deps: SqliteWasmDep,
): (
  db: SqliteDbPtr,
  zSql: WasmPtr,
  nByte: number,
  prepFlags: number,
  ppStmt: WasmPtr,
  pzTail: 0 | WasmPtr,
) => SqliteResultCode;
```

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

Compiles the first statement of UTF-8 SQL, reading at most nByte bytes or up
to a NUL when nByte is negative, and writes the statement to `*ppStmt` and
the address of the uncompiled rest to `*pzTail`. `*ppStmt` is NULL on error
and for SQL without a statement, such as only a comment; the caller finalizes
a non-NULL one.

Wasm type `i(iiiiii)`. Signature `["sqlite3_prepare_v3", "int", "sqlite3*",
"*", "int", "int", "**", "**"]` from Evolu's supplement: SQLite binds it by
hand to accept JavaScript strings.

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