pub struct VecConnection { /* private fields */ }Expand description
A raw SQLite connection with sqlite-vec registered.
This wraps a *mut sqlite3 handle opened via FFI and provides vec-specific
operations. The handle points to the same database file as the main
libsql::Connection, allowing vec operations (ANN virtual table) alongside
normal queries on the main connection.
Implementations§
Source§impl VecConnection
impl VecConnection
Sourcepub fn open(db_path: &Path) -> Option<Self>
pub fn open(db_path: &Path) -> Option<Self>
Open a raw connection to db_path and register sqlite-vec on it.
Returns None if the path can’t be converted to a C string or if
opening / extension registration fails.
Sourcepub fn execute(&self, sql: &str) -> Result<(), String>
pub fn execute(&self, sql: &str) -> Result<(), String>
Execute a SQL statement with no parameters.
Sourcepub fn prepare(&self, sql: &str) -> Result<VecStmt, String>
pub fn prepare(&self, sql: &str) -> Result<VecStmt, String>
Prepare a SQL statement and return a raw handle for manual binding.
The caller is responsible for stepping, reading results, and
finalizing via VecStmt.
Sourcepub fn handle(&self) -> *mut sqlite3
pub fn handle(&self) -> *mut sqlite3
Get the raw sqlite3 handle (for direct FFI use in store operations).
Sourcepub fn last_insert_rowid(&self) -> i64
pub fn last_insert_rowid(&self) -> i64
Return the rowid returned by last_insert_rowid().
Trait Implementations§
Source§impl Drop for VecConnection
impl Drop for VecConnection
impl Send for VecConnection
impl Sync for VecConnection
Auto Trait Implementations§
impl Freeze for VecConnection
impl RefUnwindSafe for VecConnection
impl Unpin for VecConnection
impl UnsafeUnpin for VecConnection
impl UnwindSafe for VecConnection
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
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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request