MCPcopy Index your code
hub / github.com/nodejs/node / makeSourceDb

Function makeSourceDb

test/parallel/test-sqlite-backup.mjs:21–38  ·  view source on GitHub ↗
(dbPath = ':memory:')

Source from the content-addressed store, hash-verified

19}
20
21function makeSourceDb(dbPath = ':memory:') {
22 const database = new DatabaseSync(dbPath);
23
24 database.exec(`
25 CREATE TABLE data(
26 key INTEGER PRIMARY KEY,
27 value TEXT
28 ) STRICT
29 `);
30
31 const insert = database.prepare('INSERT INTO data (key, value) VALUES (?, ?)');
32
33 for (let i = 1; i <= 2; i++) {
34 insert.run(i, `value-${i}`);
35 }
36
37 return database;
38}
39
40describe('backup()', () => {
41 test('throws if the source database is not provided', (t) => {

Callers 1

Calls 3

execMethod · 0.45
prepareMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…