From f0bcb26f32dfebd7fa0d8465492ec56f226931c0 Mon Sep 17 00:00:00 2001 From: Rob Meng Date: Mon, 14 Aug 2023 18:22:02 -0400 Subject: [PATCH] Upgrade lance and pass AWS creds when opening a table (#426) --- Cargo.toml | 3 +-- node/src/index.ts | 11 ++++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 07aef08b..0ef5d7dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ members = [ resolver = "2" [workspace.dependencies] -lance = "=0.6.1" +lance = "=0.6.2" arrow-array = "43.0" arrow-data = "43.0" arrow-schema = "43.0" @@ -14,4 +14,3 @@ arrow-ipc = "43.0" half = { "version" = "=2.2.1", default-features = false } object_store = "0.6.1" snafu = "0.7.4" - diff --git a/node/src/index.ts b/node/src/index.ts index fc634d85..fef34bbb 100644 --- a/node/src/index.ts +++ b/node/src/index.ts @@ -256,7 +256,16 @@ export class LocalConnection implements Connection { async openTable (name: string, embeddings: EmbeddingFunction): Promise> async openTable (name: string, embeddings?: EmbeddingFunction): Promise> async openTable (name: string, embeddings?: EmbeddingFunction): Promise> { - const tbl = await databaseOpenTable.call(this._db, name) + // TODO: move this thing into rust + const callArgs = [this._db, name] + if (this._options.awsCredentials !== undefined) { + callArgs.push(this._options.awsCredentials.accessKeyId) + callArgs.push(this._options.awsCredentials.secretKey) + if (this._options.awsCredentials.sessionToken !== undefined) { + callArgs.push(this._options.awsCredentials.sessionToken) + } + } + const tbl = await databaseOpenTable.call(...callArgs) if (embeddings !== undefined) { return new LocalTable(tbl, name, this._options, embeddings) } else {