From 8bc11bfcfc5bdf5270fb29266f73875a947cbc58 Mon Sep 17 00:00:00 2001 From: Prince Jain Date: Sun, 1 Nov 2026 01:54:28 +0530 Subject: [PATCH] test(nodejs): cover camelCase column names across table surfaces References #3211. The core `col()` camelCase integration coverage requested by #3211 is already on `main` from #4493. This PR adds the adjacent raw-SQL table-surface regressions that were previously uncovered: - unquoted `where("camelCase = 1")` - `update` and `delete` with unquoted camelCase predicates - `mergeInsert` with a camelCase join key, including matched-update and not-matched-insert input - `addColumns` `valueSql` referencing a camelCase column - `createIndex` on a camelCase column These are characterization tests for the existing local-backend behavior. They do not add `col()` coverage or require a live remote service. --- nodejs/__test__/table.test.ts | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/nodejs/__test__/table.test.ts b/nodejs/__test__/table.test.ts index b41d98767..eca91aba0 100644 --- a/nodejs/__test__/table.test.ts +++ b/nodejs/__test__/table.test.ts @@ -4973,6 +4973,44 @@ describe("column name options", () => { expect(results[0].camelCase).toBe(1); }); + test("can filter on an unquoted camelCase column", async () => { + const results = await table.query().where("camelCase = 1").toArray(); + expect(results[0].camelCase).toBe(1); + }); + + test("can update and delete by camelCase column", async () => { + await table.update({ where: "camelCase = 1", values: { camelCase: 2 } }); + expect(await table.query().where("camelCase = 2").toArray()).toHaveLength( + 1, + ); + await table.delete("camelCase = 2"); + expect(await table.countRows()).toBe(0); + }); + + test("can mergeInsert on a camelCase join key", async () => { + await table + .mergeInsert("camelCase") + .whenMatchedUpdateAll() + .whenNotMatchedInsertAll() + .execute([ + { camelCase: 1, vector: [0.3, 0.4] }, + { camelCase: 5, vector: [0.5, 0.6] }, + ]); + expect(await table.countRows()).toBe(2); + const inserted = await table.query().where("camelCase = 5").toArray(); + expect(inserted).toHaveLength(1); + }); + + test("can reference a camelCase column in addColumns sql", async () => { + await table.addColumns([{ name: "doubled", valueSql: "camelCase * 2" }]); + const results = await table.query().select(["doubled"]).toArray(); + expect(results[0].doubled).toBe(2); + }); + + test("can createIndex on a camelCase column", async () => { + await table.createIndex("camelCase"); + }); + test("can make multiple vector queries in one go", async () => { const results = await table .query()