pub struct LibSqlite3 { /* private fields */ }Expand description
Dynamic libsqlite3 backend adapter loaded via dlopen.
Implementations§
Source§impl LibSqlite3
impl LibSqlite3
Sourcepub fn load() -> Option<&'static LibSqlite3>
pub fn load() -> Option<&'static LibSqlite3>
Load libsqlite3 and return a process-wide adapter instance.
Returns None if the library or required symbols are unavailable.
Sourcepub unsafe fn abi_db_filename(
&self,
db: *mut c_void,
name: Option<&str>,
) -> Option<RawBytes>
pub unsafe fn abi_db_filename( &self, db: *mut c_void, name: Option<&str>, ) -> Option<RawBytes>
ABI helper: sqlite3_db_filename.
The returned bytes are backend-managed and follow SQLite pointer lifetime rules.
§Safety
db must be a valid sqlite3* from this loaded backend, and must
remain valid for the duration of the call.
Sourcepub unsafe fn abi_get_autocommit(&self, db: *mut c_void) -> i32
pub unsafe fn abi_get_autocommit(&self, db: *mut c_void) -> i32
Sourcepub unsafe fn abi_total_changes(&self, db: *mut c_void) -> i32
pub unsafe fn abi_total_changes(&self, db: *mut c_void) -> i32
Sourcepub unsafe fn abi_changes(&self, db: *mut c_void) -> i32
pub unsafe fn abi_changes(&self, db: *mut c_void) -> i32
Sourcepub unsafe fn abi_changes64(&self, db: *mut c_void) -> i64
pub unsafe fn abi_changes64(&self, db: *mut c_void) -> i64
Sourcepub unsafe fn abi_last_insert_rowid(&self, db: *mut c_void) -> i64
pub unsafe fn abi_last_insert_rowid(&self, db: *mut c_void) -> i64
ABI helper: sqlite3_last_insert_rowid.
§Safety
db must be a valid sqlite3* from this loaded backend.
Sourcepub unsafe fn abi_interrupt(&self, db: *mut c_void)
pub unsafe fn abi_interrupt(&self, db: *mut c_void)
Sourcepub unsafe fn abi_stmt_readonly(&self, stmt: *mut c_void) -> i32
pub unsafe fn abi_stmt_readonly(&self, stmt: *mut c_void) -> i32
ABI helper: sqlite3_stmt_readonly.
§Safety
stmt must be a valid sqlite3_stmt* from this loaded backend.
Sourcepub unsafe fn abi_stmt_busy(&self, stmt: *mut c_void) -> i32
pub unsafe fn abi_stmt_busy(&self, stmt: *mut c_void) -> i32
Sourcepub unsafe fn abi_bind_parameter_count(&self, stmt: *mut c_void) -> i32
pub unsafe fn abi_bind_parameter_count(&self, stmt: *mut c_void) -> i32
ABI helper: sqlite3_bind_parameter_count.
§Safety
stmt must be a valid sqlite3_stmt* from this loaded backend.
Sourcepub unsafe fn abi_bind_parameter_name(
&self,
stmt: *mut c_void,
idx: i32,
) -> Option<RawBytes>
pub unsafe fn abi_bind_parameter_name( &self, stmt: *mut c_void, idx: i32, ) -> Option<RawBytes>
ABI helper: sqlite3_bind_parameter_name.
The returned bytes are backend-managed and follow SQLite pointer lifetime rules.
§Safety
stmt must be a valid sqlite3_stmt* from this loaded backend.
Trait Implementations§
Source§impl Sqlite3Api for LibSqlite3
impl Sqlite3Api for LibSqlite3
Source§type VTabCursor = c_void
type VTabCursor = c_void
sqlite3_vtab_cursor* type.Source§fn api_version(&self) -> ApiVersion
fn api_version(&self) -> ApiVersion
Source§fn feature_set(&self) -> FeatureSet
fn feature_set(&self) -> FeatureSet
Source§fn backend_name(&self) -> &'static str
fn backend_name(&self) -> &'static str
Source§fn backend_version(&self) -> Option<ApiVersion>
fn backend_version(&self) -> Option<ApiVersion>
Source§unsafe fn malloc(&self, size: usize) -> *mut c_void
unsafe fn malloc(&self, size: usize) -> *mut c_void
Source§fn threadsafe(&self) -> i32
fn threadsafe(&self) -> i32
sqlite3_threadsafe() form.Source§unsafe fn open(
&self,
filename: &str,
options: OpenOptions<'_>,
) -> Result<NonNull<Self::Db>>
unsafe fn open( &self, filename: &str, options: OpenOptions<'_>, ) -> Result<NonNull<Self::Db>>
open_v2 semantics.Source§unsafe fn close(&self, db: NonNull<Self::Db>) -> Result<()>
unsafe fn close(&self, db: NonNull<Self::Db>) -> Result<()>
Source§unsafe fn prepare_v2(
&self,
db: NonNull<Self::Db>,
sql: &str,
) -> Result<NonNull<Self::Stmt>>
unsafe fn prepare_v2( &self, db: NonNull<Self::Db>, sql: &str, ) -> Result<NonNull<Self::Stmt>>
prepare_v2 behavior.Source§unsafe fn prepare_v3(
&self,
db: NonNull<Self::Db>,
sql: &str,
flags: u32,
) -> Result<NonNull<Self::Stmt>>
unsafe fn prepare_v3( &self, db: NonNull<Self::Db>, sql: &str, flags: u32, ) -> Result<NonNull<Self::Stmt>>
prepare_v3 flags.Source§unsafe fn step(&self, stmt: NonNull<Self::Stmt>) -> Result<StepResult>
unsafe fn step(&self, stmt: NonNull<Self::Stmt>) -> Result<StepResult>
Source§unsafe fn reset(&self, stmt: NonNull<Self::Stmt>) -> Result<()>
unsafe fn reset(&self, stmt: NonNull<Self::Stmt>) -> Result<()>
Source§unsafe fn finalize(&self, stmt: NonNull<Self::Stmt>) -> Result<()>
unsafe fn finalize(&self, stmt: NonNull<Self::Stmt>) -> Result<()>
Source§unsafe fn bind_null(&self, stmt: NonNull<Self::Stmt>, idx: i32) -> Result<()>
unsafe fn bind_null(&self, stmt: NonNull<Self::Stmt>, idx: i32) -> Result<()>
idx (1-based).Source§unsafe fn bind_int64(
&self,
stmt: NonNull<Self::Stmt>,
idx: i32,
v: i64,
) -> Result<()>
unsafe fn bind_int64( &self, stmt: NonNull<Self::Stmt>, idx: i32, v: i64, ) -> Result<()>
idx (1-based).Source§unsafe fn bind_double(
&self,
stmt: NonNull<Self::Stmt>,
idx: i32,
v: f64,
) -> Result<()>
unsafe fn bind_double( &self, stmt: NonNull<Self::Stmt>, idx: i32, v: f64, ) -> Result<()>
idx (1-based).Source§unsafe fn bind_text(
&self,
stmt: NonNull<Self::Stmt>,
idx: i32,
v: &str,
) -> Result<()>
unsafe fn bind_text( &self, stmt: NonNull<Self::Stmt>, idx: i32, v: &str, ) -> Result<()>
idx (1-based). Read moreSource§unsafe fn bind_text_bytes(
&self,
stmt: NonNull<Self::Stmt>,
idx: i32,
v: &[u8],
) -> Result<()>
unsafe fn bind_text_bytes( &self, stmt: NonNull<Self::Stmt>, idx: i32, v: &[u8], ) -> Result<()>
idx (1-based). Read moreSource§unsafe fn bind_blob(
&self,
stmt: NonNull<Self::Stmt>,
idx: i32,
v: &[u8],
) -> Result<()>
unsafe fn bind_blob( &self, stmt: NonNull<Self::Stmt>, idx: i32, v: &[u8], ) -> Result<()>
idx (1-based). Read moreSource§unsafe fn column_count(&self, stmt: NonNull<Self::Stmt>) -> i32
unsafe fn column_count(&self, stmt: NonNull<Self::Stmt>) -> i32
Source§unsafe fn column_type(&self, stmt: NonNull<Self::Stmt>, col: i32) -> ValueType
unsafe fn column_type(&self, stmt: NonNull<Self::Stmt>, col: i32) -> ValueType
col in the current row.Source§unsafe fn column_int64(&self, stmt: NonNull<Self::Stmt>, col: i32) -> i64
unsafe fn column_int64(&self, stmt: NonNull<Self::Stmt>, col: i32) -> i64
col in the current row.Source§unsafe fn column_double(&self, stmt: NonNull<Self::Stmt>, col: i32) -> f64
unsafe fn column_double(&self, stmt: NonNull<Self::Stmt>, col: i32) -> f64
col in the current row.Source§unsafe fn column_text(&self, stmt: NonNull<Self::Stmt>, col: i32) -> RawBytes
unsafe fn column_text(&self, stmt: NonNull<Self::Stmt>, col: i32) -> RawBytes
col in the current row snapshot.Source§unsafe fn column_blob(&self, stmt: NonNull<Self::Stmt>, col: i32) -> RawBytes
unsafe fn column_blob(&self, stmt: NonNull<Self::Stmt>, col: i32) -> RawBytes
col in the current row snapshot.Source§unsafe fn errcode(&self, db: NonNull<Self::Db>) -> i32
unsafe fn errcode(&self, db: NonNull<Self::Db>) -> i32
Source§unsafe fn errmsg(&self, db: NonNull<Self::Db>) -> *const c_char
unsafe fn errmsg(&self, db: NonNull<Self::Db>) -> *const c_char
Source§unsafe fn extended_errcode(&self, db: NonNull<Self::Db>) -> Option<i32>
unsafe fn extended_errcode(&self, db: NonNull<Self::Db>) -> Option<i32>
Source§unsafe fn create_function_v2(
&self,
db: NonNull<Self::Db>,
name: &str,
n_args: i32,
flags: FunctionFlags,
x_func: Option<extern "C" fn(*mut Self::Context, i32, *mut *mut Self::Value)>,
x_step: Option<extern "C" fn(*mut Self::Context, i32, *mut *mut Self::Value)>,
x_final: Option<extern "C" fn(*mut Self::Context)>,
user_data: *mut c_void,
drop_user_data: Option<extern "C" fn(*mut c_void)>,
) -> Result<()>
unsafe fn create_function_v2( &self, db: NonNull<Self::Db>, name: &str, n_args: i32, flags: FunctionFlags, x_func: Option<extern "C" fn(*mut Self::Context, i32, *mut *mut Self::Value)>, x_step: Option<extern "C" fn(*mut Self::Context, i32, *mut *mut Self::Value)>, x_final: Option<extern "C" fn(*mut Self::Context)>, user_data: *mut c_void, drop_user_data: Option<extern "C" fn(*mut c_void)>, ) -> Result<()>
Source§unsafe fn create_window_function(
&self,
db: NonNull<Self::Db>,
name: &str,
n_args: i32,
flags: FunctionFlags,
x_step: Option<extern "C" fn(*mut Self::Context, i32, *mut *mut Self::Value)>,
x_final: Option<extern "C" fn(*mut Self::Context)>,
x_value: Option<extern "C" fn(*mut Self::Context)>,
x_inverse: Option<extern "C" fn(*mut Self::Context, i32, *mut *mut Self::Value)>,
user_data: *mut c_void,
drop_user_data: Option<extern "C" fn(*mut c_void)>,
) -> Result<()>
unsafe fn create_window_function( &self, db: NonNull<Self::Db>, name: &str, n_args: i32, flags: FunctionFlags, x_step: Option<extern "C" fn(*mut Self::Context, i32, *mut *mut Self::Value)>, x_final: Option<extern "C" fn(*mut Self::Context)>, x_value: Option<extern "C" fn(*mut Self::Context)>, x_inverse: Option<extern "C" fn(*mut Self::Context, i32, *mut *mut Self::Value)>, user_data: *mut c_void, drop_user_data: Option<extern "C" fn(*mut c_void)>, ) -> Result<()>
Source§unsafe fn create_collation_v2(
&self,
db: NonNull<Self::Db>,
name: &str,
enc: i32,
context: *mut c_void,
cmp: Option<extern "C" fn(*mut c_void, i32, *const c_void, i32, *const c_void) -> i32>,
destroy: Option<extern "C" fn(*mut c_void)>,
) -> Result<()>
unsafe fn create_collation_v2( &self, db: NonNull<Self::Db>, name: &str, enc: i32, context: *mut c_void, cmp: Option<extern "C" fn(*mut c_void, i32, *const c_void, i32, *const c_void) -> i32>, destroy: Option<extern "C" fn(*mut c_void)>, ) -> Result<()>
Source§unsafe fn aggregate_context(
&self,
ctx: NonNull<Self::Context>,
bytes: usize,
) -> *mut c_void
unsafe fn aggregate_context( &self, ctx: NonNull<Self::Context>, bytes: usize, ) -> *mut c_void
ctx.Source§unsafe fn result_null(&self, ctx: NonNull<Self::Context>)
unsafe fn result_null(&self, ctx: NonNull<Self::Context>)
Source§unsafe fn result_int64(&self, ctx: NonNull<Self::Context>, v: i64)
unsafe fn result_int64(&self, ctx: NonNull<Self::Context>, v: i64)
Source§unsafe fn result_double(&self, ctx: NonNull<Self::Context>, v: f64)
unsafe fn result_double(&self, ctx: NonNull<Self::Context>, v: f64)
Source§unsafe fn result_text(&self, ctx: NonNull<Self::Context>, v: &str)
unsafe fn result_text(&self, ctx: NonNull<Self::Context>, v: &str)
v.Source§unsafe fn result_text_bytes(&self, ctx: NonNull<Self::Context>, v: &[u8])
unsafe fn result_text_bytes(&self, ctx: NonNull<Self::Context>, v: &[u8])
v. Read moreSource§unsafe fn result_blob(&self, ctx: NonNull<Self::Context>, v: &[u8])
unsafe fn result_blob(&self, ctx: NonNull<Self::Context>, v: &[u8])
v.Source§unsafe fn result_error(&self, ctx: NonNull<Self::Context>, msg: &str)
unsafe fn result_error(&self, ctx: NonNull<Self::Context>, msg: &str)
Source§unsafe fn user_data(ctx: NonNull<Self::Context>) -> *mut c_void
unsafe fn user_data(ctx: NonNull<Self::Context>) -> *mut c_void
user_data for ctx.Source§unsafe fn value_type(&self, v: NonNull<Self::Value>) -> ValueType
unsafe fn value_type(&self, v: NonNull<Self::Value>) -> ValueType
Source§unsafe fn value_int64(&self, v: NonNull<Self::Value>) -> i64
unsafe fn value_int64(&self, v: NonNull<Self::Value>) -> i64
Source§unsafe fn value_double(&self, v: NonNull<Self::Value>) -> f64
unsafe fn value_double(&self, v: NonNull<Self::Value>) -> f64
Source§unsafe fn value_text(&self, v: NonNull<Self::Value>) -> RawBytes
unsafe fn value_text(&self, v: NonNull<Self::Value>) -> RawBytes
Source§unsafe fn value_blob(&self, v: NonNull<Self::Value>) -> RawBytes
unsafe fn value_blob(&self, v: NonNull<Self::Value>) -> RawBytes
Source§impl Sqlite3Backup for LibSqlite3
impl Sqlite3Backup for LibSqlite3
Source§unsafe fn backup_init(
&self,
dest_db: NonNull<Self::Db>,
dest_name: &str,
source_db: NonNull<Self::Db>,
source_name: &str,
) -> Result<NonNull<Self::Backup>>
unsafe fn backup_init( &self, dest_db: NonNull<Self::Db>, dest_name: &str, source_db: NonNull<Self::Db>, source_name: &str, ) -> Result<NonNull<Self::Backup>>
source_db/source_name into dest_db/dest_name.Source§unsafe fn backup_step(
&self,
backup: NonNull<Self::Backup>,
pages: i32,
) -> Result<()>
unsafe fn backup_step( &self, backup: NonNull<Self::Backup>, pages: i32, ) -> Result<()>
pages pages from source to destination.Source§unsafe fn backup_remaining(&self, backup: NonNull<Self::Backup>) -> i32
unsafe fn backup_remaining(&self, backup: NonNull<Self::Backup>) -> i32
Source§impl Sqlite3BlobIo for LibSqlite3
impl Sqlite3BlobIo for LibSqlite3
Source§unsafe fn blob_open(
&self,
db: NonNull<Self::Db>,
db_name: &str,
table: &str,
column: &str,
rowid: i64,
flags: u32,
) -> Result<NonNull<Self::Blob>>
unsafe fn blob_open( &self, db: NonNull<Self::Db>, db_name: &str, table: &str, column: &str, rowid: i64, flags: u32, ) -> Result<NonNull<Self::Blob>>
Source§unsafe fn blob_read(
&self,
blob: NonNull<Self::Blob>,
data: &mut [u8],
offset: i32,
) -> Result<()>
unsafe fn blob_read( &self, blob: NonNull<Self::Blob>, data: &mut [u8], offset: i32, ) -> Result<()>
blob into data starting at offset.Source§impl Sqlite3Hooks for LibSqlite3
impl Sqlite3Hooks for LibSqlite3
Source§unsafe fn trace_v2(
&self,
db: NonNull<Self::Db>,
mask: u32,
callback: Option<extern "C" fn(u32, *mut c_void, *mut c_void, *mut c_void)>,
context: *mut c_void,
) -> Result<()>
unsafe fn trace_v2( &self, db: NonNull<Self::Db>, mask: u32, callback: Option<extern "C" fn(u32, *mut c_void, *mut c_void, *mut c_void)>, context: *mut c_void, ) -> Result<()>
sqlite3_trace_v2 callback.Source§unsafe fn progress_handler(
&self,
db: NonNull<Self::Db>,
n: i32,
callback: Option<extern "C" fn(*mut c_void) -> i32>,
context: *mut c_void,
) -> Result<()>
unsafe fn progress_handler( &self, db: NonNull<Self::Db>, n: i32, callback: Option<extern "C" fn(*mut c_void) -> i32>, context: *mut c_void, ) -> Result<()>
Source§unsafe fn busy_timeout(&self, db: NonNull<Self::Db>, ms: i32) -> Result<()>
unsafe fn busy_timeout(&self, db: NonNull<Self::Db>, ms: i32) -> Result<()>
Source§impl Sqlite3Metadata for LibSqlite3
impl Sqlite3Metadata for LibSqlite3
Source§unsafe fn table_column_metadata(
&self,
db: NonNull<Self::Db>,
db_name: Option<&str>,
table: &str,
column: &str,
) -> Result<ColumnMetadata>
unsafe fn table_column_metadata( &self, db: NonNull<Self::Db>, db_name: Option<&str>, table: &str, column: &str, ) -> Result<ColumnMetadata>
Source§unsafe fn column_decltype(
&self,
stmt: NonNull<Self::Stmt>,
col: i32,
) -> Option<RawBytes>
unsafe fn column_decltype( &self, stmt: NonNull<Self::Stmt>, col: i32, ) -> Option<RawBytes>
col.Source§impl Sqlite3Serialize for LibSqlite3
impl Sqlite3Serialize for LibSqlite3
Source§unsafe fn serialize(
&self,
db: NonNull<Self::Db>,
schema: Option<&str>,
flags: u32,
) -> Result<OwnedBytes>
unsafe fn serialize( &self, db: NonNull<Self::Db>, schema: Option<&str>, flags: u32, ) -> Result<OwnedBytes>
Source§unsafe fn deserialize(
&self,
db: NonNull<Self::Db>,
schema: Option<&str>,
data: &[u8],
flags: u32,
) -> Result<()>
unsafe fn deserialize( &self, db: NonNull<Self::Db>, schema: Option<&str>, data: &[u8], flags: u32, ) -> Result<()>
Source§unsafe fn free(&self, bytes: OwnedBytes)
unsafe fn free(&self, bytes: OwnedBytes)
serialize.Source§impl Sqlite3Wal for LibSqlite3
impl Sqlite3Wal for LibSqlite3
Source§unsafe fn wal_checkpoint(
&self,
db: NonNull<Self::Db>,
db_name: Option<&str>,
) -> Result<()>
unsafe fn wal_checkpoint( &self, db: NonNull<Self::Db>, db_name: Option<&str>, ) -> Result<()>
db_name (or main when None).