UNPKG

godot-sqlite-kysely

Version:

Kysely dialect for godot-sqlite. Adds SQLite support to Godot/GodotJS.

39 lines (31 loc) 839 B
import { Driver, Kysely, Dialect, QueryCompiler, SqliteAdapter, DialectAdapter, SqliteIntrospector, SqliteQueryCompiler, DatabaseIntrospector, } from 'kysely'; import { GodotSQLiteKyselyDriver } from './GodotSQLiteKyselyDriver'; import type { GodotSQLiteKyselyConfig } from './types'; export class GodotSQLiteKyselyDialect implements Dialect { #config: GodotSQLiteKyselyConfig; constructor(config: GodotSQLiteKyselyConfig) { this.#config = { ...config }; } createDriver(): Driver { return new GodotSQLiteKyselyDriver(this.#config); } createQueryCompiler(): QueryCompiler { return new SqliteQueryCompiler(); } createAdapter(): DialectAdapter { return new SqliteAdapter(); } createIntrospector(db: Kysely<any>): DatabaseIntrospector { return new SqliteIntrospector(db); } }