sqlite_wasm_rs::c

Function sqlite3_deserialize

Source
pub unsafe fn sqlite3_deserialize(
    db: *mut sqlite3,
    schema: *const c_char,
    data: *mut c_uchar,
    dbSize: sqlite3_int64,
    bufferSize: sqlite3_int64,
    flags: c_uint,
) -> c_int
Expand description

Causes the database connection db to disconnect from database schema and then reopen schema as an in-memory database based on the serialization contained in data. The serialized database data is dbSize bytes in size. bufferSize is the size of the buffer data, which might be larger than dbSize. If bufferSize is larger than dbSize, and the SQLITE_DESERIALIZE_READONLY bit is not set in flags, then SQLite is permitted to add content to the in-memory database as long as the total size does not exceed bufferSize bytes.

ACHTUNG: There are severe caveats regarding memory allocations when using this function in JavaScript. See https://sqlite.org/wasm/doc/trunk/api-c-style.md#sqlite3_deserialize for

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