pub struct Sqlite;Expand description
Namespace for SQLite database constructors.
Provides ergonomic factory methods for creating SQLite-backed storage.
All methods return SqlxBackend which implements BackendImpl.
§Example
ⓘ
use eidetica::backend::database::Sqlite;
// File-based storage
let backend = Sqlite::open("my_data.db").await?;
// In-memory (for testing)
let backend = Sqlite::in_memory().await?;Implementations§
Source§impl Sqlite
impl Sqlite
Sourcepub async fn open<P: AsRef<Path>>(path: P) -> Result<SqlxBackend>
pub async fn open<P: AsRef<Path>>(path: P) -> Result<SqlxBackend>
Open a SQLite database at the given path.
Creates the database file and schema if they don’t exist.
§Arguments
path- Path to the SQLite database file
Sourcepub async fn in_memory() -> Result<SqlxBackend>
pub async fn in_memory() -> Result<SqlxBackend>
Create an in-memory SQLite database.
The database exists only for the lifetime of the returned backend. Useful for testing.
Auto Trait Implementations§
impl Freeze for Sqlite
impl RefUnwindSafe for Sqlite
impl Send for Sqlite
impl Sync for Sqlite
impl Unpin for Sqlite
impl UnwindSafe for Sqlite
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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