// Test-only shim: maps the better-sqlite3 API onto Node's built-in node:sqlite. // Used ONLY for local integration testing (production uses real better-sqlite3 // inside the Docker image). The SQL executed is identical. import { DatabaseSync } from 'node:sqlite'; class Statement { constructor(stmt) { this.stmt = stmt; if (typeof stmt.setAllowBareNamedParameters === 'function') { stmt.setAllowBareNamedParameters(true); } } run(...args) { return this.stmt.run(...args); } get(...args) { return this.stmt.get(...args); } all(...args) { return this.stmt.all(...args); } } export default class Database { constructor(path) { this.db = new DatabaseSync(path); } pragma(s) { return this.db.exec('PRAGMA ' + s + ';'); } exec(sql) { return this.db.exec(sql); } prepare(sql) { return new Statement(this.db.prepare(sql)); } close() { this.db.close(); } }