sqlite: add timeout options to DatabaseSync

PR-URL: https://github.com/nodejs/node/pull/57752
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Edy Silva authored and RafaelGSS committed 2025-05-02 17:06:18 -03:00
1 parent ce1b5aabd4
commit 0df87e07a0
5 files changed
+112

No files matched your search

@@ -77,6 +77,15 @@ suite('DatabaseSync() constructor', () => {
});
});
test('throws if options.timeout is provided but is not an integer', (t) => {
t.assert.throws(() => {
new DatabaseSync('foo', { timeout: .99 });
}, {
code: 'ERR_INVALID_ARG_TYPE',
message: /The "options\.timeout" argument must be an integer/,
});
});
test('is not read-only by default', (t) => {
const dbPath = nextDb();
const db = new DatabaseSync(dbPath);