Skip to content

Commit

Permalink
feat(lancedb): Public method for opening table (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
timonv authored Dec 30, 2024
1 parent 176378f commit 52e341e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions swiftide-integrations/src/lancedb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@ impl LanceDB {
.await
.map_err(|e| anyhow::anyhow!(e))
}

/// Opens the lancedb table
///
/// # Errors
///
/// Returns an error if the table cannot be opened or the connection cannot be acquired.
pub async fn open_table(&self) -> Result<lancedb::Table> {
let conn = self.get_connection().await?;
conn.open_table(&self.table_name)
.execute()
.await
.context("Failed to open table")
}
}

impl LanceDBBuilder {
Expand Down

0 comments on commit 52e341e

Please sign in to comment.