import { SqliteAdapter, SqliteIntrospector, SqliteQueryCompiler } from "kysely";
import { SqliteWasmDriver } from "./kysely-driver/sqlite-wasm-driver.js";
/**
 * Creates a Kysely dialect that talks to a WebAssembly powered SQLite database.
 *
 * Dialects configure how Kysely executes queries under the hood. The returned
 * dialect wires up the WebAssembly driver, adapter, and introspector so we can
 * use a browser-first SQLite database transparently throughout the SDK.
 *
 * @example
 *   const db = await createInMemoryDatabase({ readOnly: false });
 *   const dialect = createLixDialect({ sqlite: db });
 */
export const createLixDialect = (args) => {
    return {
        createAdapter: () => new SqliteAdapter(),
        createDriver: () => new SqliteWasmDriver({
            database: args.sqlite,
        }),
        createIntrospector: (db) => new SqliteIntrospector(db),
        createQueryCompiler: () => new SqliteQueryCompiler(),
    };
};
//# sourceMappingURL=lix-dialect.js.map