From 98b12caa069c90d75d2dbad2651975d04050a04f Mon Sep 17 00:00:00 2001 From: Rob Meng Date: Tue, 11 Jul 2023 17:21:10 -0400 Subject: [PATCH] export create table with aws credentials (#282) --- node/src/index.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/node/src/index.ts b/node/src/index.ts index 4f1cc400..830bedd4 100644 --- a/node/src/index.ts +++ b/node/src/index.ts @@ -166,13 +166,10 @@ export class LocalConnection implements Connection { * @param embeddings An embedding function to use on this Table */ async openTable (name: string, embeddings: EmbeddingFunction): Promise> - async openTable (name: string, embeddings?: EmbeddingFunction): Promise> { + async openTable (name: string, embeddings?: EmbeddingFunction, awsCredentials?: AwsCredentials): Promise> + async openTable (name: string, embeddings?: EmbeddingFunction, awsCredentials?: AwsCredentials): Promise> { const tbl = await databaseOpenTable.call(this._db, name) - if (embeddings !== undefined) { - return new LocalTable(tbl, name, embeddings) - } else { - return new LocalTable(tbl, name) - } + return new LocalTable(tbl, name, embeddings, awsCredentials) } /** @@ -194,6 +191,7 @@ export class LocalConnection implements Connection { * @param embeddings An embedding function to use on this Table */ async createTable (name: string, data: Array>, mode: WriteMode, embeddings: EmbeddingFunction): Promise> + async createTable (name: string, data: Array>, mode: WriteMode, embeddings?: EmbeddingFunction, awsCredentials?: AwsCredentials): Promise> async createTable (name: string, data: Array>, mode: WriteMode, embeddings?: EmbeddingFunction, awsCredentials?: AwsCredentials): Promise> { if (mode === undefined) { mode = WriteMode.Create