bind/js: Partially implements pragma

Some pragmas may return more than one value, which would
break the current logic. So this cause should be handled in the future
This commit is contained in:
Diego Reis 2025-05-25 15:56:28 -03:00
parent 1ff454853b
commit 60b78b3566
4 changed files with 70 additions and 9 deletions

View file

@ -52,6 +52,12 @@ test("Empty prepared statement should throw", async (t) => {
);
});
test("Test pragma", async (t) => {
const [db] = await connect(":memory:");
t.deepEqual(typeof db.pragma("cache_size")[0].cache_size, "number");
t.deepEqual(typeof db.pragma("cache_size", { simple: true }), "number");
});
const connect = async (path) => {
const db = new Database(path);
return [db];