Create SQLite loadable extensions in Rust. The design philosophy of the API is gradual enhancement: extensions written with this crate support versions of SQLite back to 3.6.8, unless they explicitly require newer features.
static
- The consumer of this crate is not an SQLite loadable extension. The SQLite API will be provided by the linker. To avoid link errors, sqlite3_ext disables all APIs that are added after 3.6.8.static_modern
- Same as static
, but sqlite3ext does not disable any APIs. This will cause link errors if the linked version of SQLite is older than the version supported by sqlite3ext.There are three supported compilation modes for sqlite3_ext:
crate-type = [ "cdylib" ]
and is loaded into another process as an SQLite loadable extension.
crate-type = [ "staticlib" ]
and is statically linked into another program.
static
, the crate is able to be linked into a Rust or C program statically. This is highly compatible, but disables many features of SQLite.static_modern
, the crate is able to be linked into a Rust or C program statically. This requires that the system's SQLite is at least the version supported by sqlite3_ext, or there will be link errors.Tests run with modern SQLite:
Cargo.toml
with crate feature static
.Cargo.toml
with crate feature static_modern
.Todo:
Here is a compatibility chart showing which parts of the SQLite API are currently covered by sqlite3_ext. Iconography:
| Interface | Object | Status | Details | | --| :-- | :-: | :-- | | sqlite3aggregatecontext | sqlite3context | :whitecheckmark: | Arbitrary structs supported | | sqlite3autoextension | - | :whitecheckmark: | Extension::registerauto | | sqlite3autovacuumpages | | | | | sqlite3backupfinish | | | | | sqlite3backupinit | | | | | sqlite3backuppagecount | | | | | sqlite3backupremaining | | | | | sqlite3backupstep | | | | | sqlite3bindblob | sqlite3stmt | :whitecheckmark: | ToParam | | sqlite3bindblob64 | sqlite3stmt | :whitecheckmark: | ToParam | | sqlite3binddouble | sqlite3stmt | :whitecheckmark: | ToParam | | sqlite3bindint | sqlite3stmt | :greyexclamation: | Unnecessary | | sqlite3bindint64 | sqlite3stmt | :whitecheckmark: | ToParam | | sqlite3bindnull | sqlite3stmt | :whitecheckmark: | ToParam | | sqlite3bindparametercount | sqlite3stmt | :whitecheckmark: | Statement::parametercount | | sqlite3bindparameterindex | sqlite3stmt | :whitecheckmark: | Statement::parameterposition | | sqlite3bindparametername | sqlite3stmt | :whitecheckmark: | Statement::parametername | | sqlite3bindpointer | sqlite3stmt | :whitecheckmark: | ToParam | | sqlite3bindtext | sqlite3stmt | :whitecheckmark: | ToParam | | sqlite3bindtext16 | sqlite3stmt | :greyexclamation: | Use UTF-8 equivalent | | sqlite3bindtext64 | sqlite3stmt | :whitecheckmark: | ToParam | | sqlite3bindvalue | sqlite3stmt | :whitecheckmark: | ToParam | | sqlite3bindzeroblob | sqlite3stmt | | | | sqlite3bindzeroblob64 | sqlite3stmt | | | | sqlite3blobbytes | | | | | sqlite3blobclose | | | | | sqlite3blobopen | | | | | sqlite3blobread | | | | | sqlite3blobreopen | | | | | sqlite3blobwrite | | | | | sqlite3busyhandler | | | | | sqlite3busytimeout | | | | | sqlite3cancelautoextension | - | :whitecheckmark: | Extension::cancelauto | | sqlite3changes | | :whitecheckmark: | Statement::execute | | sqlite3changes64 | | :whitecheckmark: | Statement::execute | | sqlite3clearbindings | sqlite3stmt | :greyexclamation: | Unnecessary | | sqlite3close | | | | | sqlite3closev2 | | | | | sqlite3collationneeded | sqlite3 | :whitecheckmark: | Connection::setcollationneededfunc | | sqlite3collationneeded16 | sqlite3 | :greyexclamation: | Use UTF-8 equivalent | | sqlite3columnblob | sqlite3stmt | :whitecheckmark: | Column::getblob | | sqlite3columnbytes | sqlite3stmt | :greyexclamation: | Unnecessary | | sqlite3columnbytes16 | sqlite3stmt | :greyexclamation: | Use UTF-8 equivalent | | sqlite3columncount | sqlite3stmt | :whitecheckmark: | Statement::columncount | | sqlite3columndatabasename | sqlite3stmt | :whitecheckmark: | Column::databasename | | sqlite3columndatabasename16 | sqlite3stmt | :greyexclamation: | Use UTF-8 equivalent | | sqlite3columndecltype | sqlite3stmt | :whitecheckmark: | Column::decltype | | sqlite3columndecltype16 | sqlite3stmt | :greyexclamation: | Use UTF-8 equivalent | | sqlite3columndouble | sqlite3stmt | :whitecheckmark: | Column::getf64 | | sqlite3columnint | sqlite3stmt | :whitecheckmark: | Column::geti32 | | sqlite3columnint64 | sqlite3stmt | :whitecheckmark: | Column::geti64 | | sqlite3columnname | sqlite3stmt | :whitecheckmark: | Column::name | | sqlite3columnname16 | sqlite3stmt | :greyexclamation: | Use UTF-8 equivalent | | sqlite3columnoriginname | sqlite3stmt | :whitecheckmark: | Column::originname | | sqlite3columnoriginname16 | sqlite3stmt | :greyexclamation: | Use UTF-8 equivalent | | sqlite3columntablename | sqlite3stmt | :whitecheckmark: | Column::tablename | | sqlite3columntablename16 | sqlite3stmt | :greyexclamation: | Use UTF-8 equivalent | | sqlite3columntext | sqlite3stmt | :whitecheckmark: | Column::getstr | | sqlite3columntext16 | sqlite3stmt | :greyexclamation: | Use UTF-8 equivalent | | sqlite3columntype | sqlite3stmt | :whitecheckmark: | Column::valuetype | | sqlite3columnvalue | sqlite3stmt | :whitecheckmark: | Column::asref | | sqlite3commithook | sqlite3 | | | | sqlite3compileoptionget | | | | | sqlite3compileoptionused | | | | | sqlite3complete | | | | | sqlite3complete16 | | :greyexclamation: | Use UTF-8 equivalent | | sqlite3config | | | | | sqlite3contextdbhandle | sqlite3context | :whitecheckmark: | Context::db | | sqlite3createcollation | sqlite3 | :whitecheckmark: | Connection::createcollation | | sqlite3createcollation16 | sqlite3 | :greyexclamation: | Use UTF-8 equivalent | | sqlite3createcollationv2 | sqlite3 | :whitecheckmark: | Connection::createcollation | | sqlite3createfilename | | | | | sqlite3createfunction | sqlite3 | :whitecheckmark: | Connection::createscalarfunction | | sqlite3createfunction16 | sqlite3 | :greyexclamation: | Use UTF-8 equivalent | | sqlite3createfunctionv2 | sqlite3 | :whitecheckmark: | Connection::createscalarfunction | | sqlite3createmodule | sqlite3 | :whitecheckmark: | Connection::createmodule | | sqlite3createmodulev2 | sqlite3 | :whitecheckmark: | Connection::createmodule | | sqlite3createwindowfunction | sqlite3 | :whitecheckmark: | Connection::createaggregatefunction | | sqlite3datacount | sqlite3stmt | | | | sqlite3databasefileobject | | | | | sqlite3dbcacheflush | | | | | sqlite3dbconfig | | | | | sqlite3dbfilename | | | | | sqlite3dbhandle | sqlite3stmt | :whitecheckmark: | Statement::db | | sqlite3dbmutex | sqlite3 | :whitecheckmark: | Connection::lock | | sqlite3dbreadonly | | | | | sqlite3dbreleasememory | | | | | sqlite3dbstatus | | | | | sqlite3declarevtab | | :whitecheckmark: | VTab::connect | | sqlite3deserialize | | | | | sqlite3dropmodules | | | | | sqlite3enableloadextension | sqlite3 | :greyexclamation: | Available via ffi | | sqlite3enablesharedcache | | | | | sqlite3errcode | sqlite3 | | | | sqlite3errmsg | sqlite3 | | | | sqlite3errmsg16 | sqlite3 | :greyexclamation: | Use UTF-8 equivalent | | sqlite3erroroffset | sqlite3 | | | | sqlite3errstr | - | :whitecheckmark: | Error::fmt | | sqlite3exec | sqlite3 | :greyexclamation: | Unnecessary | | sqlite3expandedsql | sqlite3stmt | | | | sqlite3extendederrcode | sqlite3 | | | | sqlite3extendedresultcodes | sqlite3 | | | | sqlite3filecontrol | | | | | sqlite3filenamedatabase | | | | | sqlite3filenamejournal | | | | | sqlite3filenamewal | | | | | sqlite3finalize | sqlite3stmt | :greyexclamation: | Unnecessary | | sqlite3free | | :greyexclamation: | Available via ffi | | sqlite3freefilename | | | | | sqlite3freetable | | :greyexclamation: | Available via ffi | | sqlite3getautocommit | | | | | sqlite3getauxdata | sqlite3context | :whitecheckmark: | Context::auxdata | | sqlite3gettable | | :greyexclamation: | Available via ffi | | sqlite3hardheaplimit64 | | | | | sqlite3initialize | | :greyexclamation: | Available via ffi | | sqlite3interrupt | | | | | sqlite3keywordcheck | | | | | sqlite3keywordcount | | | | | sqlite3keywordname | | | | | sqlite3lastinsertrowid | | | | | sqlite3libversion | | :whitecheckmark: | SQLITEVERSION.asstr | | sqlite3libversionnumber | | :whitecheckmark: | SQLITEVERSION.get | | sqlite3limit | sqlite3 | | | | sqlite3loadextension | sqlite3 | | | | sqlite3log | | | | | sqlite3malloc | | :greyexclamation: | Available via ffi | | sqlite3malloc64 | | :greyexclamation: | Available via ffi | | sqlite3memoryhighwater | | | | | sqlite3memoryused | | | | | sqlite3mprintf | char | :greyexclamation: | Available via ffi | | sqlite3msize | | :greyexclamation: | Available via ffi | | sqlite3mutexalloc | | :greyexclamation: | Available via ffi | | sqlite3mutexenter | | :greyexclamation: | Available via ffi | | sqlite3mutexfree | | :greyexclamation: | Available via ffi | | sqlite3mutexheld | | :greyexclamation: | Available via ffi | | sqlite3mutexleave | | :greyexclamation: | Available via ffi | | sqlite3mutexnotheld | | :greyexclamation: | Available via ffi | | sqlite3mutextry | | :greyexclamation: | Available via ffi | | sqlite3nextstmt | | | | | sqlite3normalizedsql | sqlite3stmt | | | | sqlite3open | sqlite3 | | | | sqlite3open16 | sqlite3 | :greyexclamation: | Use UTF-8 equivalent | | sqlite3openv2 | sqlite3 | | | | sqlite3overloadfunction | sqlite3 | :whitecheckmark: | Connection::createoverloadedfunction | | sqlite3prepare | sqlite3stmt | :greyexclamation: | Unnecessary | | sqlite3prepare16 | sqlite3stmt | :greyexclamation: | Use UTF-8 equivalent | | sqlite3prepare16v2 | sqlite3stmt | :greyexclamation: | Use UTF-8 equivalent | | sqlite3prepare16v3 | sqlite3stmt | :greyexclamation: | Use UTF-8 equivalent | | sqlite3preparev2 | sqlite3stmt | :whitecheckmark: | Connection::prepare | | sqlite3preparev3 | sqlite3stmt | :whitecheckmark: | Connection::prepare | | sqlite3preupdateblobwrite | | | | | sqlite3preupdatecount | | | | | sqlite3preupdatedepth | | | | | sqlite3preupdatehook | | | | | sqlite3preupdatenew | | | | | sqlite3preupdateold | | | | | sqlite3profile | | | | | sqlite3progresshandler | | | | | sqlite3randomness | | :whitecheckmark: | sqlite3randomness | | sqlite3realloc | | :greyexclamation: | Available via ffi | | sqlite3realloc64 | | :greyexclamation: | Available via ffi | | sqlite3releasememory | | | | | sqlite3reset | sqlite3stmt | :whitecheckmark: | Statement::query | | sqlite3resetautoextension | | :whitecheckmark: | Extension::resetauto | | sqlite3resultblob | sqlite3context | :whitecheckmark: | ToContextResult | | sqlite3resultblob64 | sqlite3context | :whitecheckmark: | ToContextResult | | sqlite3resultdouble | sqlite3context | :whitecheckmark: | ToContextResult | | sqlite3resulterror | sqlite3context | :whitecheckmark: | ToContextResult | | sqlite3resulterror16 | sqlite3context | :greyexclamation: | Use UTF-8 equivalent | | sqlite3resulterrorcode | sqlite3context | :whitecheckmark: | ToContextResult | | sqlite3resulterrornomem | sqlite3context | | | | sqlite3resulterrortoobig | sqlite3context | | | | sqlite3resultint | sqlite3context | :whitecheckmark: | ToContextResult | | sqlite3resultint64 | sqlite3context | :whitecheckmark: | ToContextResult | | sqlite3resultnull | sqlite3context | :whitecheckmark: | ToContextResult | | sqlite3resultpointer | sqlite3context | :whitecheckmark: | PassedRef | | sqlite3resultsubtype | sqlite3context | :whitecheckmark: | UnsafePtr | | sqlite3resulttext | sqlite3context | :whitecheckmark: | ToContextResult | | sqlite3resulttext16 | sqlite3context | :greyexclamation: | Use UTF-8 equivalent | | sqlite3resulttext16be | sqlite3context | :greyexclamation: | Use UTF-8 equivalent | | sqlite3resulttext16le | sqlite3context | :greyexclamation: | Use UTF-8 equivalent | | sqlite3resulttext64 | sqlite3context | :whitecheckmark: | ToContextResult | | sqlite3resultvalue | sqlite3context | :whitecheckmark: | ToContextResult | | sqlite3resultzeroblob | sqlite3context | | | | sqlite3resultzeroblob64 | sqlite3context | | | | sqlite3rollbackhook | sqlite3 | | | | sqlite3serialize | | | | | sqlite3setauthorizer | | | | | sqlite3setauxdata | sqlite3context | :whitecheckmark: | Context::setauxdata | | sqlite3setlastinsertrowid | sqlite3 | :greyexclamation: | Available via ffi | | sqlite3shutdown | | :greyexclamation: | Available via ffi | | sqlite3sleep | | :greyexclamation: | Available via ffi | | sqlite3snapshotcmp | | | | | sqlite3snapshotfree | | | | | sqlite3snapshotget | | | | | sqlite3snapshotopen | | | | | sqlite3snapshotrecover | | | | | sqlite3snprintf | char | :greyexclamation: | Available via ffi | | sqlite3softheaplimit64 | | | | | sqlite3sourceid | | :whitecheckmark: | SQLITEVERSION.sourceid | | sqlite3sql | sqlite3stmt | :whitecheckmark: | Statement::sql | | sqlite3status | | | | | sqlite3status64 | | | | | sqlite3step | sqlite3stmt | :whitecheckmark: | ResultSet::next | | sqlite3stmtbusy | sqlite3stmt | | | | sqlite3stmtisexplain | sqlite3stmt | | | | sqlite3stmtreadonly | sqlite3stmt | | | | sqlite3stmtscanstatus | sqlite3stmt | | | | sqlite3stmtscanstatusreset | sqlite3stmt | | | | sqlite3stmtstatus | sqlite3stmt | | | | sqlite3strappend | sqlite3str | :greyexclamation: | Available via ffi | | sqlite3strappendall | sqlite3str | :greyexclamation: | Available via ffi | | sqlite3strappendchar | sqlite3str | :greyexclamation: | Available via ffi | | sqlite3strappendf | sqlite3str | :greyexclamation: | Available via ffi | | sqlite3strerrcode | sqlite3str | :greyexclamation: | Available via ffi | | sqlite3strfinish | sqlite3str | :greyexclamation: | Available via ffi | | sqlite3strlength | sqlite3str | :greyexclamation: | Available via ffi | | sqlite3strnew | sqlite3str | :greyexclamation: | Available via ffi | | sqlite3strreset | sqlite3str | :greyexclamation: | Available via ffi | | sqlite3strvalue | sqlite3str | :greyexclamation: | Available via ffi | | sqlite3strvappendf | sqlite3str | :greyexclamation: | Available via ffi | | sqlite3strglob | char | :whitecheckmark: | sqlite3strglob | | sqlite3stricmp | char | :whitecheckmark: | sqlite3stricmp | | sqlite3strlike | char | :whitecheckmark: | sqlite3strlike | | sqlite3strnicmp | char | :greyexclamation: | Unnecessary | | sqlite3systemerrno | sqlite3 | :greyexclamation: | Available via ffi | | sqlite3tablecolumnmetadata | | | | | sqlite3threadsafe | | :greyexclamation: | Available via ffi | | sqlite3totalchanges | sqlite3 | | | | sqlite3totalchanges64 | sqlite3 | | | | sqlite3trace | | | | | sqlite3tracev2 | | | | | sqlite3txnstate | | | | | sqlite3unlocknotify | | | | | sqlite3updatehook | | | | | sqlite3uriboolean | | :greyexclamation: | Available via ffi | | sqlite3uriint64 | | :greyexclamation: | Available via ffi | | sqlite3urikey | | :greyexclamation: | Available via ffi | | sqlite3uriparameter | | :greyexclamation: | Available via ffi | | sqlite3userdata | sqlite3context | :whitecheckmark: | Use a closure for the function | | sqlite3valueblob | sqlite3value | :whitecheckmark: | ValueRef::getblob | | sqlite3valuebytes | sqlite3value | :greyexclamation: | Unnecessary | | sqlite3valuebytes16 | sqlite3value | :greyexclamation: | Use UTF-8 equivalent | | sqlite3valuedouble | sqlite3value | :whitecheckmark: | ValueRef::getf64 | | sqlite3valuedup | sqlite3value | | | | sqlite3valuefree | sqlite3value | :greyexclamation: | Unnecesary | | sqlite3valuefrombind | sqlite3value | :whitecheckmark: | ValueRef::isfrombind | | sqlite3valueint | sqlite3value | :whitecheckmark: | ValueRef::geti32 | | sqlite3valueint64 | sqlite3value | :whitecheckmark: | ValueRef::geti64 | | sqlite3valuenochange | sqlite3value | :whitecheckmark: | ValueRef::nochange | | sqlite3valuenumerictype | sqlite3value | :whitecheckmark: | ValueRef::numerictype | | sqlite3valuepointer | sqlite3value | :whitecheckmark: | ValueRef::getref | | sqlite3valuesubtype | sqlite3value | :whitecheckmark: | UnsafePtr | | sqlite3valuetext | sqlite3value | :whitecheckmark: | ValueRef::getstr | | sqlite3valuetext16 | sqlite3value | :greyexclamation: | Use UTF-8 equivalent | | sqlite3valuetext16be | sqlite3value | :greyexclamation: | Use UTF-8 equivalent | | sqlite3valuetext16le | sqlite3value | :greyexclamation: | Use UTF-8 equivalent | | sqlite3valuetype | sqlite3value | :whitecheckmark: | ValueRef::valuetype | | sqlite3vfsfind | | | | | sqlite3vfsregister | | | | | sqlite3vfsunregister | | | | | sqlite3vmprintf | char | :greyexclamation: | Unnecessary | | sqlite3vsnprintf | char | :greyexclamation: | Unnecessary | | sqlite3vtabcollation | sqlite3indexinfo | :whitecheckmark: | IndexInfoConstraint::collation | | sqlite3vtabconfig | sqlite3 | :whitecheckmark: | VTabConnection | | sqlite3vtabdistinct | sqlite3indexinfo | :whitecheckmark: | IndexInfo::distinctmode | | sqlite3vtabin | sqlite3indexinfo | :whitecheckmark: | IndexInfoConstraint::setvaluelistwanted | | sqlite3vtabinfirst | sqlite3value | :whitecheckmark: | ValueList | | sqlite3vtabinnext | sqlite3value | :whitecheckmark: | ValueList | | sqlite3vtabnochange | sqlite3context | :whitecheckmark: | ColumnContext::nochange | | sqlite3vtabonconflict | sqlite3 | :whitecheckmark: | ChangeInfo::conflictmode | | sqlite3vtabrhsvalue | sqlite3indexinfo | :whitecheckmark: | IndexInfoConstraint::rhs | | sqlite3walautocheckpoint | | | | | sqlite3walcheckpoint | | | | | sqlite3walcheckpointv2 | | | | | sqlite3walhook | | | | | sqlite3win32setdirectory | | | | | sqlite3win32setdirectory16 | | :greyexclamation: | Use UTF-8 equivalent | | sqlite3win32set_directory8 | | | |