pub struct LanceDbStore { /* private fields */ }Expand description
Wrapper around LanceDB connection for Uni storage.
This provides a unified interface for all table operations, replacing direct Lance Dataset usage.
Implementations§
Source§impl LanceDbStore
impl LanceDbStore
Sourcepub async fn connect(uri: &str) -> Result<Self>
pub async fn connect(uri: &str) -> Result<Self>
Connect to a LanceDB database at the given URI.
Supported URIs:
/path/to/database- local filesystems3://bucket/path- AWS S3gs://bucket/path- Google Cloud Storage
Sourcepub async fn connect_with_storage_options(
uri: &str,
storage_options: Option<HashMap<String, String>>,
) -> Result<Self>
pub async fn connect_with_storage_options( uri: &str, storage_options: Option<HashMap<String, String>>, ) -> Result<Self>
Connect to a LanceDB database with explicit storage options.
Sourcepub async fn table_names(&self) -> Result<Vec<String>>
pub async fn table_names(&self) -> Result<Vec<String>>
List all table names in the database.
Sourcepub async fn table_exists(&self, name: &str) -> Result<bool>
pub async fn table_exists(&self, name: &str) -> Result<bool>
Check if a table exists.
Sourcepub async fn open_table(&self, name: &str) -> Result<Table>
pub async fn open_table(&self, name: &str) -> Result<Table>
Open an existing table.
Sourcepub async fn create_table(
&self,
name: &str,
batches: Vec<RecordBatch>,
) -> Result<Table>
pub async fn create_table( &self, name: &str, batches: Vec<RecordBatch>, ) -> Result<Table>
Create a new table with initial data.
If the table already exists, this will fail.
Sourcepub async fn create_empty_table(
&self,
name: &str,
schema: Arc<ArrowSchema>,
) -> Result<Table>
pub async fn create_empty_table( &self, name: &str, schema: Arc<ArrowSchema>, ) -> Result<Table>
Create a new empty table with a schema.
Sourcepub async fn open_or_create_table(
&self,
name: &str,
schema: Arc<ArrowSchema>,
) -> Result<Table>
pub async fn open_or_create_table( &self, name: &str, schema: Arc<ArrowSchema>, ) -> Result<Table>
Open a table, creating it if it doesn’t exist.
Sourcepub async fn drop_table(&self, name: &str) -> Result<()>
pub async fn drop_table(&self, name: &str) -> Result<()>
Drop a table by name.
Sourcepub async fn drop_all_tables(&self) -> Result<()>
pub async fn drop_all_tables(&self) -> Result<()>
Drop all tables in the database.
Sourcepub async fn append_to_table(
&self,
table: &Table,
batches: Vec<RecordBatch>,
) -> Result<()>
pub async fn append_to_table( &self, table: &Table, batches: Vec<RecordBatch>, ) -> Result<()>
Append data to an existing table.
Sourcepub fn main_vertex_table_name() -> &'static str
pub fn main_vertex_table_name() -> &'static str
Get the table name for the main vertices table.
The main vertices table contains all vertices regardless of label, enabling fast ID-based lookups without knowing the label.
Sourcepub fn main_edge_table_name() -> &'static str
pub fn main_edge_table_name() -> &'static str
Get the table name for the main edges table.
The main edges table contains all edges regardless of type, enabling fast ID-based lookups without knowing the edge type.
Sourcepub async fn open_main_vertex_table(&self) -> Result<Table>
pub async fn open_main_vertex_table(&self) -> Result<Table>
Sourcepub async fn open_main_edge_table(&self) -> Result<Table>
pub async fn open_main_edge_table(&self) -> Result<Table>
Sourcepub async fn main_vertex_table_exists(&self) -> Result<bool>
pub async fn main_vertex_table_exists(&self) -> Result<bool>
Check if the main vertices table exists.
Sourcepub async fn main_edge_table_exists(&self) -> Result<bool>
pub async fn main_edge_table_exists(&self) -> Result<bool>
Check if the main edges table exists.
Sourcepub fn vertex_table_name(label: &str) -> String
pub fn vertex_table_name(label: &str) -> String
Get the table name for a vertex label.
Sourcepub async fn open_or_create_vertex_table(
&self,
label: &str,
schema: Arc<ArrowSchema>,
) -> Result<Table>
pub async fn open_or_create_vertex_table( &self, label: &str, schema: Arc<ArrowSchema>, ) -> Result<Table>
Open or create a vertex table for a label.
Sourcepub async fn open_vertex_table(&self, label: &str) -> Result<Table>
pub async fn open_vertex_table(&self, label: &str) -> Result<Table>
Open a vertex table for a label.
Sourcepub async fn vertex_table_exists(&self, label: &str) -> Result<bool>
pub async fn vertex_table_exists(&self, label: &str) -> Result<bool>
Check if a vertex table exists for a label.
Sourcepub fn delta_table_name(edge_type: &str, direction: &str) -> String
pub fn delta_table_name(edge_type: &str, direction: &str) -> String
Get the table name for edge deltas.
Sourcepub async fn open_or_create_delta_table(
&self,
edge_type: &str,
direction: &str,
schema: Arc<ArrowSchema>,
) -> Result<Table>
pub async fn open_or_create_delta_table( &self, edge_type: &str, direction: &str, schema: Arc<ArrowSchema>, ) -> Result<Table>
Open or create a delta table.
Sourcepub async fn open_delta_table(
&self,
edge_type: &str,
direction: &str,
) -> Result<Table>
pub async fn open_delta_table( &self, edge_type: &str, direction: &str, ) -> Result<Table>
Open a delta table.
Sourcepub fn adjacency_table_name(edge_type: &str, direction: &str) -> String
pub fn adjacency_table_name(edge_type: &str, direction: &str) -> String
Get the table name for adjacency data.
Sourcepub async fn open_or_create_adjacency_table(
&self,
edge_type: &str,
direction: &str,
schema: Arc<ArrowSchema>,
) -> Result<Table>
pub async fn open_or_create_adjacency_table( &self, edge_type: &str, direction: &str, schema: Arc<ArrowSchema>, ) -> Result<Table>
Open or create an adjacency table.
Sourcepub async fn open_adjacency_table(
&self,
edge_type: &str,
direction: &str,
) -> Result<Table>
pub async fn open_adjacency_table( &self, edge_type: &str, direction: &str, ) -> Result<Table>
Open an adjacency table.
Sourcepub async fn get_table_version(&self, table_name: &str) -> Result<Option<u64>>
pub async fn get_table_version(&self, table_name: &str) -> Result<Option<u64>>
Get the current version of a table.
Returns None if the table does not exist.
§Errors
Returns an error if the table exists but version query fails.
Sourcepub async fn rollback_table(
&self,
table_name: &str,
target_version: u64,
) -> Result<()>
pub async fn rollback_table( &self, table_name: &str, target_version: u64, ) -> Result<()>
Roll back a table to a specific version.
This uses LanceDB’s checkout and restore APIs to create a new version
that matches the state at target_version.
§Errors
Returns an error if the table cannot be opened or rollback fails.
Sourcepub async fn replace_table_atomic(
&self,
name: &str,
batches: Vec<RecordBatch>,
schema: Arc<ArrowSchema>,
) -> Result<Table>
pub async fn replace_table_atomic( &self, name: &str, batches: Vec<RecordBatch>, schema: Arc<ArrowSchema>, ) -> Result<Table>
Replace a table’s contents atomically using Lance’s overwrite mode.
When the table already exists, this uses add().mode(Overwrite) to create
a new dataset version without dropping the table. This is critical for
concurrency safety: the old data files remain on disk (referenced by older
versions) until Prune runs, so concurrent readers can finish without
hitting “file not found” errors.
When the table does not exist, it creates a new table normally.
§Arguments
name- The table name to replacebatches- The new data (can be empty)schema- The Arrow schema for the table
§Errors
Returns an error if table operations fail.
Sourcepub async fn recover_staging(&self, name: &str) -> Result<()>
pub async fn recover_staging(&self, name: &str) -> Result<()>
Recover a table from its staging table if needed.
This method handles crash recovery scenarios:
- If
{name}_stagingexists AND{name}exists → drop staging (leftover) - If
{name}_stagingexists AND{name}missing → restore main from staging
Call this on startup for all known table patterns to recover from crashes.
§Arguments
name- The table name to recover
§Errors
Returns an error if recovery operations fail.
Auto Trait Implementations§
impl !RefUnwindSafe for LanceDbStore
impl !UnwindSafe for LanceDbStore
impl Freeze for LanceDbStore
impl Send for LanceDbStore
impl Sync for LanceDbStore
impl Unpin for LanceDbStore
impl UnsafeUnpin for LanceDbStore
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> PluginState for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.