pub struct SqliteConnection { /* private fields */ }Expand description
A connection to a SQLite database.
This is a thread-safe wrapper around a SQLite database handle.
Implementations§
Source§impl SqliteConnection
impl SqliteConnection
Sourcepub fn open(config: &SqliteConfig) -> Result<Self, Error>
pub fn open(config: &SqliteConfig) -> Result<Self, Error>
Open a new SQLite connection with the given configuration.
Sourcepub fn open_memory() -> Result<Self, Error>
pub fn open_memory() -> Result<Self, Error>
Open an in-memory database.
Sourcepub fn execute_raw(&self, sql: &str) -> Result<(), Error>
pub fn execute_raw(&self, sql: &str) -> Result<(), Error>
Execute SQL directly without preparing (for DDL, etc.)
Sourcepub fn backup_to_path(&self, dest_path: impl AsRef<str>) -> Result<(), Error>
pub fn backup_to_path(&self, dest_path: impl AsRef<str>) -> Result<(), Error>
Backup the current database to a destination path using the SQLite backup API.
This opens (or creates) the destination database and performs an online backup
from this connection’s main database into the destination’s main database.
Sourcepub fn backup_to_connection(&self, dest: &SqliteConnection) -> Result<(), Error>
pub fn backup_to_connection(&self, dest: &SqliteConnection) -> Result<(), Error>
Backup the current database to another open SQLite connection.
The destination must not use SQLite shared-cache mode because this wrapper cannot coordinate other connections attached to that cache.
Sourcepub fn last_insert_rowid(&self) -> i64
pub fn last_insert_rowid(&self) -> i64
Get the last insert rowid.
Source§impl SqliteConnection
impl SqliteConnection
Sourcepub fn emit_busy_waiting(&self, _elapsed_secs: f64)
pub fn emit_busy_waiting(&self, _elapsed_secs: f64)
No-op when console feature is disabled.
Sourcepub fn emit_checkpoint_progress(&self, _pages_done: u32, _pages_total: u32)
pub fn emit_checkpoint_progress(&self, _pages_done: u32, _pages_total: u32)
No-op when console feature is disabled.