Add queue tables, quote SQL identifiers (v1.3.0)
- isQueue table option adds queue columns and a (status, available_at) index; BunSQLite.queue exposes add, claim, complete, fail and release_stale with atomic claims - Set busy_timeout on connections so workers in separate processes wait instead of failing with SQLITE_BUSY - Quote table and column names with backticks in generated SQL, so reserved words (to, order, group) work and unknown columns error instead of matching as string literals - Tests for queue ops, multi-process claims and reserved-word names Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -27,7 +27,7 @@ describe("sqlInsertGenerator", () => {
|
||||
],
|
||||
});
|
||||
expect(res?.query).toBe(
|
||||
"INSERT INTO items (name,active,qty,note) VALUES (?,?,?,?),(?,?,?,?)",
|
||||
"INSERT INTO `items` (`name`,`active`,`qty`,`note`) VALUES (?,?,?,?),(?,?,?,?)",
|
||||
);
|
||||
expect(res?.values).toEqual(["a", 0, 0, null, "b", null, null, ""]);
|
||||
});
|
||||
@@ -46,7 +46,7 @@ describe("sqlInsertGenerator", () => {
|
||||
],
|
||||
});
|
||||
expect(calls).toBe(1);
|
||||
expect(res?.query).toBe("INSERT INTO items (emb) VALUES (vec_f32(?))");
|
||||
expect(res?.query).toBe("INSERT INTO `items` (`emb`) VALUES (vec_f32(?))");
|
||||
expect(res?.values).toEqual(["[1,2]"]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user