fix(node): read consistency level fix (#1567)

PR fixes #1565
This commit is contained in:
Gagan Bhullar
2024-08-27 18:03:42 -06:00
committed by GitHub
parent ae85008714
commit a76186ee83
2 changed files with 25 additions and 1 deletions

View File

@@ -93,6 +93,30 @@ describe("LanceDB client", function () {
const con = await lancedb.connect(uri);
assert.deepEqual(await con.tableNames(), ["vectors"]);
});
it("read consistency level", async function () {
const uri = await createTestDB();
const db1 = await lancedb.connect({ uri });
const table1 = await db1.openTable("vectors");
const db2 = await lancedb.connect({
uri,
readConsistencyInterval: 0
})
const table2 = await db2.openTable("vectors");
assert.equal(await table2.countRows(), 2);
await table1.add([
{
id: 3,
name: 'name_2',
price: 10,
is_active: true,
vector: [ 0, 0.1 ]
},
]);
assert.equal(await table2.countRows(), 3);
});
});
describe("when querying an existing dataset", function () {