Initial commit - Event Planner application

This commit is contained in:
mberlin
2026-03-18 14:55:56 -03:00
commit 86d779eb4d
7548 changed files with 1006324 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
/// <reference types="./sqlite-dialect.d.ts" />
import { SqliteDriver } from './sqlite-driver.js';
import { SqliteQueryCompiler } from './sqlite-query-compiler.js';
import { SqliteIntrospector } from './sqlite-introspector.js';
import { SqliteAdapter } from './sqlite-adapter.js';
import { freeze } from '../../util/object-utils.js';
/**
* SQLite dialect that uses the [better-sqlite3](https://github.com/JoshuaWise/better-sqlite3) library.
*
* The constructor takes an instance of {@link SqliteDialectConfig}.
*
* ```ts
* import Database from 'better-sqlite3'
*
* new SqliteDialect({
* database: new Database('db.sqlite')
* })
* ```
*
* If you want the pool to only be created once it's first used, `database`
* can be a function:
*
* ```ts
* import Database from 'better-sqlite3'
*
* new SqliteDialect({
* database: async () => new Database('db.sqlite')
* })
* ```
*/
export class SqliteDialect {
#config;
constructor(config) {
this.#config = freeze({ ...config });
}
createDriver() {
return new SqliteDriver(this.#config);
}
createQueryCompiler() {
return new SqliteQueryCompiler();
}
createAdapter() {
return new SqliteAdapter();
}
createIntrospector(db) {
return new SqliteIntrospector(db);
}
}