mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(ext/node): SQLite reset guards to prevent database locks (#28298)
Fixes https://github.com/denoland/deno/issues/28295
This commit is contained in:
parent
b9cffda7c9
commit
e66ef32a8f
2 changed files with 29 additions and 4 deletions
|
@ -272,3 +272,17 @@ Deno.test("[node/sqlite] error message", () => {
|
|||
"NOT NULL constraint failed: foo.b",
|
||||
);
|
||||
});
|
||||
|
||||
// https://github.com/denoland/deno/issues/28295
|
||||
Deno.test("[node/sqlite] StatementSync reset guards don't lock db", () => {
|
||||
const db = new DatabaseSync(":memory:");
|
||||
|
||||
db.exec("CREATE TABLE foo(a integer, b text)");
|
||||
db.exec("CREATE TABLE bar(a integer, b text)");
|
||||
|
||||
const stmt = db.prepare("SELECT name FROM sqlite_master WHERE type='table' ");
|
||||
|
||||
assertEquals(stmt.get(), { name: "foo", __proto__: null });
|
||||
|
||||
db.exec("DROP TABLE IF EXISTS foo");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue