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

```ts
function sqlite3_deserialize(
  deps: SqliteWasmDep,
): (
  db: SqliteDbPtr,
  zSchema: 0 | CStringPtr,
  pData: WasmPtr,
  szDb: bigint,
  szBuf: bigint,
  mFlags: number,
) => SqliteResultCode;
```

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

Reopens a schema, main for NULL, as an in-memory database over the first szDb
bytes of a szBuf-byte buffer, which must stay valid and unmodified until the
connection closes. szBuf must be at least szDb, and about 20 bytes more for
content that may be malformed, which SQLite may read a few bytes past. With
SQLITE_DESERIALIZE_FREEONCLOSE, SQLite takes ownership of the
[sqlite3\_malloc](https://evolu.dev/docs/api-reference/sqlite-wasm/c-api/functions/sqlite3_malloc)'d buffer and frees it, even when deserializing fails.

Wasm type `i(iiijji)`. Signature `["sqlite3_deserialize", "int", "sqlite3*",
"string", "*", "i64", "i64", "int"]` from SQLite's table.

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