pub struct OwnedEmbeddedTransaction { /* private fields */ }Expand description
An embedded-local transaction that owns all state required by a Python or async handle.
The type deliberately has no borrowed lifetime. Finite compatibility operations borrow the
owned KV transaction only for their duration; public stream leases clone session and retain
ownership through the core state machine.
Implementations§
Source§impl OwnedEmbeddedTransaction
impl OwnedEmbeddedTransaction
Sourcepub fn session(&self) -> OwnedTransactionSession
pub fn session(&self) -> OwnedTransactionSession
Return the core session shared with a transaction-owned stream lease.
Sourcepub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>
pub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>
Read one key inside this owned transaction.
Sourcepub fn put(&mut self, key: &[u8], value: &[u8]) -> Result<()>
pub fn put(&mut self, key: &[u8], value: &[u8]) -> Result<()>
Stage one key/value pair inside this owned transaction.
Sourcepub fn delete(&mut self, key: &[u8]) -> Result<()>
pub fn delete(&mut self, key: &[u8]) -> Result<()>
Stage one deletion inside this owned transaction.
Sourcepub fn execute_sql(&mut self, sql: &str) -> Result<SqlResult>
pub fn execute_sql(&mut self, sql: &str) -> Result<SqlResult>
Execute SQL without committing this transaction.
The implementation is in sql_api.rs so it uses the same planner, catalog overlay, and
error mapping as the borrowed compatibility transaction.
Sourcepub fn preflight_sql_stream(&self, sql: &str) -> Result<OwnedSqlStreamPlan>
pub fn preflight_sql_stream(&self, sql: &str) -> Result<OwnedSqlStreamPlan>
Preflight a streamable local SELECT against this transaction’s catalog overlay.
The plan copies its required catalog metadata before returning, so the resulting stream lease retains no borrow of this transaction or its overlay.
Source§impl OwnedEmbeddedTransaction
impl OwnedEmbeddedTransaction
Sourcepub fn upsert_vector(
&mut self,
key: &[u8],
metadata: &[u8],
vector: &[f32],
metric: Metric,
) -> Result<()>
pub fn upsert_vector( &mut self, key: &[u8], metadata: &[u8], vector: &[f32], metric: Metric, ) -> Result<()>
Stage a vector and its metadata in an owned transaction.
Sourcepub fn get_vector(
&mut self,
key: &[u8],
metric: Metric,
) -> Result<Option<Vec<f32>>>
pub fn get_vector( &mut self, key: &[u8], metric: Metric, ) -> Result<Option<Vec<f32>>>
Retrieve one vector from an owned transaction.
Sourcepub fn get_vectors(
&mut self,
keys: &[Key],
metric: Metric,
) -> Result<Vec<Option<Vec<f32>>>>
pub fn get_vectors( &mut self, keys: &[Key], metric: Metric, ) -> Result<Vec<Option<Vec<f32>>>>
Retrieve vectors in input order from an owned transaction.
Sourcepub fn search_similar(
&mut self,
query_vector: &[f32],
metric: Metric,
top_k: usize,
filter_keys: Option<&[Key]>,
) -> Result<Vec<SearchResult>>
pub fn search_similar( &mut self, query_vector: &[f32], metric: Metric, top_k: usize, filter_keys: Option<&[Key]>, ) -> Result<Vec<SearchResult>>
Search vectors visible to this owned transaction.