The db.sqlite.ffi declarations cover the public sqlite3.h interfaces through SQLite 3.53.4, including the session, Rtree, carray, and FTS5 interfaces. SQLITE_VERSION and SQLITE_VERSION_NUMBER describe this reference header. Use sqlite3_libversion and sqlite3_compileoption_used to inspect the library actually loaded. Optional declarations do not enable their corresponding library features.
Session requires SQLITE_ENABLE_SESSION and SQLITE_ENABLE_PREUPDATE_HOOK. Other facilities, including carray, FTS5, scanstatus, normalization, snapshots, and column metadata, depend on the linked library's build options. A missing optional symbol is a library capability limitation; applications must select a build containing the features they use.
Compatibility: sqlite3_expanded_sql now returns an owned char* instead of a copied string. Decode it explicitly and release it with sqlite3_free. sqlite3_serialize now returns a raw uchar* and writes the binary length through piSize. Copy exactly that length when needed; database bytes are not a zero-terminated string. The usual serialization result must be freed with sqlite3_free; SQLITE_SERIALIZE_NOCOPY instead returns a borrowed buffer.
sqlite3_deserialize takes a raw uchar* buffer that remains valid until the connection closes. The buffer may be modified unless SQLITE_DESERIALIZE_READONLY is specified. FREEONCLOSE and RESIZEABLE require SQLite-allocated memory because SQLite may free or reallocate it, including freeing it after a failed deserialize call. Do not pass a temporary encoded string or movable Factor storage as a retained buffer.
sqlite3_prepare16 now takes a raw pointer to UTF-16 bytes, consistently with sqlite3_prepare16_v2 and sqlite3_prepare16_v3. Its byte count is measured in bytes.
sqlite3_filename is a raw char* alias. sqlite3_db_filename and sqlite3_filename_database/journal/wal preserve SQLite filename object identity; decode only when a display string is wanted. sqlite3_create_filename returns an owned filename object released by sqlite3_free_filename. URI lookup functions require the original SQLite filename object. sqlite3_database_file_object requires the original journal/WAL filename received by a VFS xOpen callback; a copied display string is invalid. db.sqlite.lib's current-sqlite-filename continues returning a Factor string.
FTS5 phrase-iterator fields retain raw byte positions. The extended FTS5 API structs and sqlite3_module include all members in the reference header. Respect each interface's iVersion when using older runtimes, and initialize versioned structs consistently with the callbacks supplied.
The session streaming, changeset-filter/conflict, preupdate, and tokenizer callback types expose raw pointers. Decode text explicitly and honor any accompanying byte length. Keep callback objects and any retained native data alive for as long as SQLite may use them. sqlite3_destructor_type is a typed callback accepting void*; SQLITE_STATIC and SQLITE_TRANSIENT remain valid pointer sentinels where SQLite documents those conventions.