import { test, expect } from "vitest";
import { Kysely } from "kysely";
import { createEnvironmentDialect } from "../../database/sqlite/environment-dialect.js";
import { InMemoryEnvironment } from "../in-memory.js";
test("EngineDriver runs basic Kysely queries", async () => {
    const backend = new InMemoryEnvironment();
    await backend.open({
        boot: { args: { providePlugins: [] } },
        emit: () => { },
    });
    const db = new Kysely({
        dialect: createEnvironmentDialect({ environment: backend }),
    });
    await db.executeQuery({ sql: "CREATE TABLE t(a)", parameters: [] });
    await db.executeQuery({
        sql: "INSERT INTO t(a) VALUES (?), (?)",
        parameters: [1, 2],
    });
    const res = await db.executeQuery({
        sql: "SELECT a FROM t ORDER BY a",
        parameters: [],
    });
    expect(res.rows.length).toBe(2);
    expect(res.rows[0]?.a ?? res.rows[0]?.[0]).toBe(1);
});
//# sourceMappingURL=kysely-driver.test.js.map