- Eltern-Ordner ist jetzt EIN Git-Repo (statt getrennter Repos). - root .gitignore haelt Secrets (.env), node_modules, DB und Build-Artefakte raus. - release.ps1: manueller Release (ZIP bauen + ans Backend laden). - root README mit Struktur und Release-Ablauf. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
25 lines
889 B
JavaScript
25 lines
889 B
JavaScript
// 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(); }
|
|
}
|