pub enum SqliteConnectionManager {
File(PathBuf),
SharedMemory {
uri: String,
},
}Expand description
A minimal r2d2::ManageConnection for rusqlite. Hand-written instead of
depending on the r2d2_sqlite crate: that crate pins its own rusqlite
version, which never lines up with the rusqlite version ling-ai
already pulls in transitively (via the burn ML framework) — and two
different rusqlite/libsqlite3-sys versions can’t coexist in one
Cargo.lock (both declare links = "sqlite3"). r2d2 itself has no
sqlite dependency, so implementing this ourselves keeps us on exactly
one rusqlite version, chosen by us, everywhere in the workspace.
Variants§
Implementations§
Trait Implementations§
Source§impl ManageConnection for SqliteConnectionManager
impl ManageConnection for SqliteConnectionManager
Source§type Connection = Connection
type Connection = Connection
The connection type this manager deals with.
Source§fn is_valid(&self, conn: &mut Connection) -> Result<(), Error>
fn is_valid(&self, conn: &mut Connection) -> Result<(), Error>
Determines if the connection is still connected to the database. Read more
Source§fn has_broken(&self, _conn: &mut Connection) -> bool
fn has_broken(&self, _conn: &mut Connection) -> bool
Quickly determines if the connection is no longer usable. Read more
Auto Trait Implementations§
impl Freeze for SqliteConnectionManager
impl RefUnwindSafe for SqliteConnectionManager
impl Send for SqliteConnectionManager
impl Sync for SqliteConnectionManager
impl Unpin for SqliteConnectionManager
impl UnsafeUnpin for SqliteConnectionManager
impl UnwindSafe for SqliteConnectionManager
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