Updated: 2022/Sep/29

Please read Privacy Policy. It's for your privacy.

SQLITE3_SERIALIZE(3)       Library Functions Manual       SQLITE3_SERIALIZE(3)

     sqlite3_serialize - Serialize a database

     unsigned char *
     sqlite3_serialize(sqlite3 *db, const char *zSchema,
         sqlite3_int64 *piSize, unsigned int mFlags    );

     The sqlite3_serialize(D,S,P,F) interface returns a pointer to memory that
     is a serialization of the S database on database connection D.  If P is
     not a NULL pointer, then the size of the database in bytes is written
     into *P.

     For an ordinary on-disk database file, the serialization is just a copy
     of the disk file.  For an in-memory database or a "TEMP" database, the
     serialization is the same sequence of bytes which would be written to
     disk if that database where backed up to disk.

     The usual case is that sqlite3_serialize() copies the serialization of
     the database into memory obtained from sqlite3_malloc64() and returns a
     pointer to that memory.  The caller is responsible for freeing the
     returned value to avoid a memory leak.  However, if the F argument
     contains the SQLITE_SERIALIZE_NOCOPY bit, then no memory allocations are
     made, and the sqlite3_serialize() function will return a pointer to the
     contiguous memory representation of the database that SQLite is currently
     using for that database, or NULL if the no such contiguous memory
     representation of the database exists.  A contiguous memory
     representation of the database will usually only exist if there has been
     a prior call to sqlite3_deserialize(D,S,...) with the same values of D
     and S.  The size of the database is written into *P even if the
     SQLITE_SERIALIZE_NOCOPY bit is set but no contiguous copy of the database

     A call to sqlite3_serialize(D,S,P,F) might return NULL even if the
     SQLITE_SERIALIZE_NOCOPY bit is omitted from argument F if a memory
     allocation error occurs.

     This interface is only available if SQLite is compiled with the

     sqlite3(3), sqlite3_malloc(3)

NetBSD 9.99                    December 19, 2018                   NetBSD 9.99