Skip to main content

OwnedEmbeddedTransaction

Struct OwnedEmbeddedTransaction 

Source
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

Source

pub fn session(&self) -> OwnedTransactionSession

Return the core session shared with a transaction-owned stream lease.

Source

pub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>

Read one key inside this owned transaction.

Source

pub fn put(&mut self, key: &[u8], value: &[u8]) -> Result<()>

Stage one key/value pair inside this owned transaction.

Source

pub fn delete(&mut self, key: &[u8]) -> Result<()>

Stage one deletion inside this owned transaction.

Source

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.

Source

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

pub fn commit(&mut self) -> Result<()>

Commit the owned transaction after staging catalog and range-change metadata.

Source

pub fn rollback(&mut self) -> Result<()>

Roll back the owned transaction once.

Source§

impl OwnedEmbeddedTransaction

Source

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.

Source

pub fn get_vector( &mut self, key: &[u8], metric: Metric, ) -> Result<Option<Vec<f32>>>

Retrieve one vector from an owned transaction.

Source

pub fn get_vectors( &mut self, keys: &[Key], metric: Metric, ) -> Result<Vec<Option<Vec<f32>>>>

Retrieve vectors in input order from an owned transaction.

Source

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.

Source

pub fn upsert_to_hnsw( &mut self, index_name: &str, key: &[u8], vector: &[f32], metadata: &[u8], ) -> Result<()>

Stage an HNSW upsert in this owned transaction.

Source

pub fn delete_from_hnsw(&mut self, index_name: &str, key: &[u8]) -> Result<bool>

Stage an HNSW deletion in this owned transaction.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more