pub struct SQLiteBackend { /* private fields */ }Implementations§
Source§impl SQLiteBackend
impl SQLiteBackend
Sourcepub async fn connect(&self) -> Result<SqliteConn>
pub async fn connect(&self) -> Result<SqliteConn>
Open a connection to the configured DB. Reads the path from the env var
at the moment of the call (mirrors Python). Sets WAL on best-effort.
Idempotent at the auto-extension level — sqlite-vec is registered once
per process via OnceLock.
Sourcepub async fn table_exists(
&self,
conn: &SqliteConn,
_db: &str,
table: &str,
) -> Result<bool>
pub async fn table_exists( &self, conn: &SqliteConn, _db: &str, table: &str, ) -> Result<bool>
Mirrors Python’s table_exists — checks sqlite_master for table or
virtual table by name. The db argument is dropped (no schemas).
Sourcepub async fn embedding_dim(
&self,
conn: &SqliteConn,
_db: &str,
table: &str,
) -> Result<Option<usize>>
pub async fn embedding_dim( &self, conn: &SqliteConn, _db: &str, table: &str, ) -> Result<Option<usize>>
Read the FLOAT[N] dim from the vec0 partner table’s CREATE statement
in sqlite_master. Returns None when the partner table doesn’t exist
or doesn’t have a FLOAT[N] column.
Sourcepub async fn with_create_lock(
&self,
_conn: &SqliteConn,
_key: &str,
) -> Result<()>
pub async fn with_create_lock( &self, _conn: &SqliteConn, _key: &str, ) -> Result<()>
SQLite has no advisory-lock primitive. Mirror Python’s no-op.
Trait Implementations§
Source§impl BackendDialect for SQLiteBackend
impl BackendDialect for SQLiteBackend
const NAME: &'static str = "sqlite"
const SUPPORTS_UPSERT: bool = true
fn quote_ident(&self, name: &str) -> String
fn fq_table(&self, _db: &str, table: &str) -> String
fn vector_type_ddl(&self, dim: usize) -> String
fn json_type_ddl(&self) -> String
fn text_pk_type_ddl(&self) -> String
fn timestamp_now_default_ddl(&self) -> String
fn vector_literal(&self, arr: &[f32]) -> String
fn json_literal(&self, obj: &Value) -> String
fn json_path_sql(&self, col_expr: &str, dotted_path: &str) -> String
fn upsert_clause(&self, key_cols: &[&str], update_cols: &[&str]) -> String
fn create_database_sql(&self, _name: &str) -> String
fn add_column_if_not_exists_sql( &self, fq: &str, col: &str, type_ddl: &str, ) -> String
fn drop_table_sql(&self, fq: &str) -> String
fn emit_chunks_table_ddl( &self, fq: &str, cols: &[ColSpec], _hnsw: bool, dim: usize, _engine: Option<&str>, _vector_metric: Option<&str>, ) -> Vec<String>
Source§impl Clone for SQLiteBackend
impl Clone for SQLiteBackend
Source§fn clone(&self) -> SQLiteBackend
fn clone(&self) -> SQLiteBackend
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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