feat(nodejs): feature parity [2/N] - add table.name and lancedb.connect({args}) (#1380)

depends on https://github.com/lancedb/lancedb/pull/1378

see proper diff here
https://github.com/universalmind303/lancedb/compare/remote-table-node...universalmind303:lancedb:table-name
This commit is contained in:
Cory Grinstead
2024-06-21 11:38:26 -05:00
committed by GitHub
parent 0fe844034d
commit b3e5ac6d2a
7 changed files with 59 additions and 18 deletions

View File

@@ -56,12 +56,6 @@ impl Connection {
#[napi(factory)]
pub async fn new(uri: String, options: ConnectionOptions) -> napi::Result<Self> {
let mut builder = ConnectBuilder::new(&uri);
if let Some(api_key) = options.api_key {
builder = builder.api_key(&api_key);
}
if let Some(host_override) = options.host_override {
builder = builder.host_override(&host_override);
}
if let Some(interval) = options.read_consistency_interval {
builder =
builder.read_consistency_interval(std::time::Duration::from_secs_f64(interval));

View File

@@ -28,8 +28,6 @@ mod util;
#[napi(object)]
#[derive(Debug)]
pub struct ConnectionOptions {
pub api_key: Option<String>,
pub host_override: Option<String>,
/// (For LanceDB OSS only): The interval, in seconds, at which to check for
/// updates to the table from other processes. If None, then consistency is not
/// checked. For performance reasons, this is the default. For strong

View File

@@ -30,7 +30,7 @@ use crate::query::{Query, VectorQuery};
pub struct Table {
// We keep a duplicate of the table name so we can use it for error
// messages even if the table has been closed
name: String,
pub name: String,
pub(crate) inner: Option<LanceDbTable>,
}