pub struct SqliteBackend { /* private fields */ }Expand description
SQLite backend backed by sqlx::SqlitePool.
Implementations§
Source§impl SqliteBackend
impl SqliteBackend
Sourcepub fn pool(&self) -> &SqlitePool
pub fn pool(&self) -> &SqlitePool
Get a reference to the underlying pool.
Sourcepub fn from_pool(pool: SqlitePool) -> Self
pub fn from_pool(pool: SqlitePool) -> Self
Create from an existing pool (useful for tests).
Trait Implementations§
Source§impl DatabaseBackend for SqliteBackend
impl DatabaseBackend for SqliteBackend
Source§fn connect<'life0, 'async_trait>(
uri: &'life0 str,
pool_size: u32,
acquire_timeout_secs: u64,
max_lifetime_secs: u64,
idle_timeout_secs: u64,
) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
uri: &'life0 str,
pool_size: u32,
acquire_timeout_secs: u64,
max_lifetime_secs: u64,
idle_timeout_secs: u64,
) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connect to the database and return a backend instance. Read more
Source§fn version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<DbVersion, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<DbVersion, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query the database server version.
Source§fn min_version(&self) -> (u32, u32)
fn min_version(&self) -> (u32, u32)
Return the minimum supported version for this backend.
Source§fn exec_raw<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: &'life2 [SqlParam],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn exec_raw<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: &'life2 [SqlParam],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute a raw SQL statement (no result set expected). Read more
Source§fn exec_statement<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: &'life2 [SqlParam],
) -> Pin<Box<dyn Future<Output = Result<StatementResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn exec_statement<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: &'life2 [SqlParam],
) -> Pin<Box<dyn Future<Output = Result<StatementResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute a CTE-wrapped statement and parse the standard result set. Read more
Source§fn exec_in_transaction<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
tx_vars: Option<&'life1 SqlBuilder>,
pre_req: Option<&'life2 SqlBuilder>,
mutation: Option<&'life3 SqlBuilder>,
main: Option<&'life4 SqlBuilder>,
) -> Pin<Box<dyn Future<Output = Result<StatementResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn exec_in_transaction<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
tx_vars: Option<&'life1 SqlBuilder>,
pre_req: Option<&'life2 SqlBuilder>,
mutation: Option<&'life3 SqlBuilder>,
main: Option<&'life4 SqlBuilder>,
) -> Pin<Box<dyn Future<Output = Result<StatementResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Begin a transaction and execute multiple statements within it. Read more
Source§fn introspector(&self) -> Box<dyn DbIntrospector + '_>
fn introspector(&self) -> Box<dyn DbIntrospector + '_>
Get a database introspector for schema cache loading.
Source§fn start_listener<'life0, 'life1, 'async_trait>(
&'life0 self,
_channel: &'life1 str,
_cancel: Receiver<bool>,
_on_event: Arc<dyn Fn(String) + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn start_listener<'life0, 'life1, 'async_trait>(
&'life0 self,
_channel: &'life1 str,
_cancel: Receiver<bool>,
_on_event: Arc<dyn Fn(String) + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Start a background change listener (e.g. PostgreSQL NOTIFY). Read more
Auto Trait Implementations§
impl Freeze for SqliteBackend
impl !RefUnwindSafe for SqliteBackend
impl Send for SqliteBackend
impl Sync for SqliteBackend
impl Unpin for SqliteBackend
impl UnsafeUnpin for SqliteBackend
impl !UnwindSafe for SqliteBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more