pub struct Transaction<'a> { /* private fields */ }Expand description
A database transaction.
Implementations§
Source§impl<'a> Transaction<'a>
impl<'a> Transaction<'a>
Sourcepub fn storage_mode(&self) -> StorageMode
pub fn storage_mode(&self) -> StorageMode
現在のカラムナーストレージモードを返す。
Sourcepub fn write_columnar_segment(
&self,
table: &str,
batch: RecordBatch,
) -> Result<u64>
pub fn write_columnar_segment( &self, table: &str, batch: RecordBatch, ) -> Result<u64>
カラムナーセグメントを書き込む(トランザクションコンテキスト利用)。
Sourcepub fn read_columnar_segment(
&self,
table: &str,
segment_id: u64,
columns: Option<&[&str]>,
) -> Result<Vec<RecordBatch>>
pub fn read_columnar_segment( &self, table: &str, segment_id: u64, columns: Option<&[&str]>, ) -> Result<Vec<RecordBatch>>
カラムナーセグメントを読み取る(トランザクションコンテキスト利用)。
Source§impl<'a> Transaction<'a>
impl<'a> Transaction<'a>
Sourcepub fn get(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>>
pub fn get(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>>
Retrieves the value for a given key.
Sourcepub fn upsert_to_hnsw(
&mut self,
index_name: &str,
key: &[u8],
vector: &[f32],
metadata: &[u8],
) -> Result<()>
pub fn upsert_to_hnsw( &mut self, index_name: &str, key: &[u8], vector: &[f32], metadata: &[u8], ) -> Result<()>
HNSW にベクトルをステージング挿入/更新する。
Sourcepub fn delete_from_hnsw(&mut self, index_name: &str, key: &[u8]) -> Result<bool>
pub fn delete_from_hnsw(&mut self, index_name: &str, key: &[u8]) -> Result<bool>
HNSW からキーをステージング削除する。
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<()>
Upserts a vector and metadata under the provided key after validating dimensions and metric.
A small internal index is maintained to enable scanning for similarity search.
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>>
Executes a flat similarity search over stored vectors using the provided metric and query.
The optional filter_keys restricts the scan to the given keys; otherwise the full
vector index is scanned. Results are sorted by descending score and truncated to top_k.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Transaction<'a>
impl<'a> !RefUnwindSafe for Transaction<'a>
impl<'a> Send for Transaction<'a>
impl<'a> Sync for Transaction<'a>
impl<'a> Unpin for Transaction<'a>
impl<'a> !UnwindSafe for Transaction<'a>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more