@electric-sql/d2ts
Version:
D2TS is a TypeScript implementation of Differential Dataflow.
24 lines • 556 B
JavaScript
/**
* Wrapper for better-sqlite3 to implement SQLiteDb interface
*/
export class BetterSQLite3Wrapper {
#db;
constructor(db) {
this.#db = db;
}
exec(sql) {
this.#db.exec(sql);
}
prepare(sql) {
const stmt = this.#db.prepare(sql);
return {
run: (...params) => stmt.run(...params),
get: (...params) => stmt.get(...params),
all: (...params) => stmt.all(...params),
};
}
close() {
this.#db.close();
}
}
//# sourceMappingURL=database.js.map