xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_deserialize.3 (revision cef8759bd76c1b621f8eab8faa6f208faabc2e15)
1.Dd December 19, 2018
2.Dt SQLITE3_DESERIALIZE 3
3.Os
4.Sh NAME
5.Nm sqlite3_deserialize
6.Nd Deserialize a database
7.Sh SYNOPSIS
8.Ft int
9.Fo sqlite3_deserialize
10.Fa "sqlite3 *db"
11.Fa "const char *zSchema"
12.Fa "unsigned char *pData"
13.Fa "sqlite3_int64 szDb"
14.Fa "sqlite3_int64 szBuf"
15.Fa "unsigned mFlags         "
16.Fc
17.Sh DESCRIPTION
18The sqlite3_deserialize(D,S,P,N,M,F) interface causes the database connection
19D to disconnect from database S and then reopen S as an in-memory database
20based on the serialization contained in P.
21The serialized database P is N bytes in size.
22M is the size of the buffer P, which might be larger than N.
23If M is larger than N, and the SQLITE_DESERIALIZE_READONLY bit is not
24set in F, then SQLite is permitted to add content to the in-memory
25database as long as the total size does not exceed M bytes.
26.Pp
27If the SQLITE_DESERIALIZE_FREEONCLOSE bit is set in F, then SQLite
28will invoke sqlite3_free() on the serialization buffer when the database
29connection closes.
30If the SQLITE_DESERIALIZE_RESIZEABLE bit is set, then SQLite will try
31to increase the buffer size using sqlite3_realloc64() if writes on
32the database cause it to grow larger than M bytes.
33.Pp
34The sqlite3_deserialize() interface will fail with SQLITE_BUSY if the
35database is currently in a read transaction or is involved in a backup
36operation.
37.Pp
38If sqlite3_deserialize(D,S,P,N,M,F) fails for any reason and if the
39SQLITE_DESERIALIZE_FREEONCLOSE bit is set in argument F, then sqlite3_free()
40is invoked on argument P prior to returning.
41.Pp
42This interface is only available if SQLite is compiled with the SQLITE_ENABLE_DESERIALIZE
43option.
44.Sh SEE ALSO
45.Xr sqlite3 3 ,
46.Xr sqlite3_malloc 3
47