From 08d62550bbb5c2ea6c175032b3e28ddeccf0b710 Mon Sep 17 00:00:00 2001 From: Bert Date: Fri, 26 Apr 2024 15:26:08 -0400 Subject: [PATCH] fix: passing data to createTable as option (#1242) Fixes issue where we would throw `Either data or schema needs to defined` when passing `data` to `createTable` as a property of the first argument (an object). ```ts await db.createTable({ name: 'table1', data, schema }) ``` --- node/src/remote/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node/src/remote/index.ts b/node/src/remote/index.ts index 29f8a2fb..0f2d3857 100644 --- a/node/src/remote/index.ts +++ b/node/src/remote/index.ts @@ -140,6 +140,9 @@ export class RemoteConnection implements Connection { schema = nameOrOpts.schema embeddings = nameOrOpts.embeddingFunction tableName = nameOrOpts.name + if (data === undefined) { + data = nameOrOpts.data + } } let buffer: Buffer