pub struct Connection { /* private fields */ }Implementations§
Source§impl Connection
impl Connection
pub fn build_limbo_ext(&self) -> ExtensionApi
pub fn register_builtins(&self) -> Result<(), String>
Source§impl Connection
impl Connection
pub fn prepare( self: &Arc<Connection>, sql: impl AsRef<str>, ) -> Result<Statement>
pub fn query( self: &Arc<Connection>, sql: impl AsRef<str>, ) -> Result<Option<Statement>>
pub fn query_runner<'a>( self: &'a Arc<Connection>, sql: &'a [u8], ) -> QueryRunner<'a> ⓘ
Sourcepub fn execute(self: &Arc<Connection>, sql: impl AsRef<str>) -> Result<()>
pub fn execute(self: &Arc<Connection>, sql: impl AsRef<str>) -> Result<()>
Execute will run a query from start to finish taking ownership of I/O because it will run pending I/Os if it didn’t finish. TODO: make this api async
pub fn wal_frame_count(&self) -> Result<u64>
pub fn wal_get_frame( &self, frame_no: u32, p_frame: *mut u8, frame_len: u32, ) -> Result<Arc<Completion>>
Sourcepub fn cacheflush(&self) -> Result<PagerCacheflushStatus>
pub fn cacheflush(&self) -> Result<PagerCacheflushStatus>
Flush dirty pages to disk. This will write the dirty pages to the WAL and then fsync the WAL. If the WAL size is over the checkpoint threshold, it will checkpoint the WAL to the database file and then fsync the database file.
pub fn clear_page_cache(&self) -> Result<()>
pub fn checkpoint(&self) -> Result<CheckpointResult>
Sourcepub fn checkpoint_truncate(&self) -> Result<CheckpointResult>
pub fn checkpoint_truncate(&self) -> Result<CheckpointResult>
Run a checkpoint in TRUNCATE mode (resets the WAL file to empty).
Sourcepub fn close(&self) -> Result<()>
pub fn close(&self) -> Result<()>
Close a connection, checkpointing and truncating the WAL so the database file is self-contained. Idempotent: a second call is a no-op.
pub fn last_insert_rowid(&self) -> i64
pub fn set_changes(&self, nchange: i64)
Sourcepub fn changes(&self) -> i64
pub fn changes(&self) -> i64
Return the number of rows changed by the most recent DML statement.
Mirrors sqlite3_changes() semantics: DDL and BEGIN/COMMIT/ROLLBACK
return 0. The count is updated by Connection::set_changes when a write transaction
commits.
pub fn total_changes(&self) -> i64
pub fn get_cache_size(&self) -> i32
pub fn set_cache_size(&self, size: i32)
pub fn open_new( &self, path: &str, vfs: &str, ) -> Result<(Arc<dyn IO>, Arc<Database>)>
pub fn list_vfs(&self) -> Vec<String>
pub fn get_auto_commit(&self) -> bool
pub fn parse_schema_rows(self: &Arc<Connection>) -> Result<()>
Sourcepub fn load_persistent_stats(self: &Arc<Connection>) -> Result<()>
pub fn load_persistent_stats(self: &Arc<Connection>) -> Result<()>
Load persisted ANALYZE statistics (sqlite_stat1) into the schema’s
in-memory side-map. No-op (bit-for-bit unchanged) when sqlite_stat1
does not exist, i.e. for databases that have never been analyzed.
Sourcepub fn pragma_query(
self: &Arc<Connection>,
pragma_name: &str,
) -> Result<Vec<Vec<Value>>>
pub fn pragma_query( self: &Arc<Connection>, pragma_name: &str, ) -> Result<Vec<Vec<Value>>>
Query the current rows/values of pragma_name.
Sourcepub fn pragma_update<V: Display>(
self: &Arc<Connection>,
pragma_name: &str,
pragma_value: V,
) -> Result<Vec<Vec<Value>>>
pub fn pragma_update<V: Display>( self: &Arc<Connection>, pragma_name: &str, pragma_value: V, ) -> Result<Vec<Vec<Value>>>
Set a new value to pragma_name.
Some pragmas will return the updated value which cannot be retrieved with this method.
Sourcepub fn pragma<V: Display>(
self: &Arc<Connection>,
pragma_name: &str,
pragma_value: V,
) -> Result<Vec<Vec<Value>>>
pub fn pragma<V: Display>( self: &Arc<Connection>, pragma_name: &str, pragma_value: V, ) -> Result<Vec<Vec<Value>>>
Query the current value(s) of pragma_name associated to
pragma_value.
This method can be used with query-only pragmas which need an argument
(e.g. table_info('one_tbl')) or pragmas which returns value(s)
(e.g. integrity_check).