pub struct Connection<'a> { /* private fields */ }Implementations§
Source§impl<'a> Connection<'a>
impl<'a> Connection<'a>
pub fn open(db: &'a Database) -> Result<Self>
Sourcepub fn txn_start_ts(&self) -> Option<i64>
pub fn txn_start_ts(&self) -> Option<i64>
Txn-start UTC µs inside BEGIN/COMMIT, else None.
Sourcepub fn session_timezone(&self) -> String
pub fn session_timezone(&self) -> String
Returns the session time-zone (IANA name or fixed offset). Default "UTC".
Sourcepub fn set_session_timezone(&self, tz: &str) -> Result<()>
pub fn set_session_timezone(&self, tz: &str) -> Result<()>
Set the session time-zone. Accepts IANA names, ISO-8601 offsets, "UTC", "Z".
pub fn execute(&self, sql: &str) -> Result<ExecutionResult>
pub fn execute_params( &self, sql: &str, params: &[Value], ) -> Result<ExecutionResult>
Sourcepub fn execute_script(&self, sql: &str) -> ScriptExecution
pub fn execute_script(&self, sql: &str) -> ScriptExecution
Execute ;-separated SQL statements. Stops at the first failure.
pub fn query(&self, sql: &str) -> Result<QueryResult>
pub fn query_params(&self, sql: &str, params: &[Value]) -> Result<QueryResult>
pub fn prepare(&self, sql: &str) -> Result<PreparedStatement<'_, 'a>>
pub fn tables(&self) -> Vec<String>
Sourcepub fn in_transaction(&self) -> bool
pub fn in_transaction(&self) -> bool
Returns true if an explicit transaction is active (BEGIN was issued).
pub fn table_schema(&self, name: &str) -> Option<TableSchema>
pub fn refresh_schema(&self) -> Result<()>
Sourcepub fn persist_ann_index(
&self,
table: &str,
column: &str,
) -> Result<AnnSegmentInfo>
pub fn persist_ann_index( &self, table: &str, column: &str, ) -> Result<AnnSegmentInfo>
Freeze the ANN index for table.column into a persisted segment: one
write txn scans, builds, serializes, and commits atomically; subsequent
cold attaches LOAD it (seconds) instead of rebuilding (minutes), with
the load-time scan re-proving freshness by content. The single writer
lock is held for the whole build - an offline/builder operation.
Refused inside an explicit transaction (it owns its own txn), and for
TEMP tables (their storage bypasses the DDL paths that purge segments).
Sourcepub fn ann_cache_status(
&self,
table: &str,
column: &str,
) -> Result<Option<(AnnIndexSource, u64)>>
pub fn ann_cache_status( &self, table: &str, column: &str, ) -> Result<Option<(AnnIndexSource, u64)>>
The identity of the index currently cached for table.column:
(source, snapshot generation) - Loaded{segment_b3} means queries are
served by the persisted segment; Built{refusal} carries why a segment
was rejected, if one was.
Trait Implementations§
Source§impl<'a> Drop for Connection<'a>
impl<'a> Drop for Connection<'a>
Auto Trait Implementations§
impl<'a> !Freeze for Connection<'a>
impl<'a> !RefUnwindSafe for Connection<'a>
impl<'a> !Sync for Connection<'a>
impl<'a> !UnwindSafe for Connection<'a>
impl<'a> Send for Connection<'a>
impl<'a> Unpin for Connection<'a>
impl<'a> UnsafeUnpin for Connection<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more