export async function createSQLiteAdapter(options = {}) {
    const filename = options.filename ?? ':memory:';
    try {
        // Optional peer deps resolved lazily at runtime only when SQLite is selected.
        // The ignore comments stop webpack/Turbopack from statically resolving (and
        // warning about) drivers a Postgres project never installs. Each `@ts-ignore`
        // sits directly above the specifier line because, for a multi-line dynamic
        // import, that is the line tsc reports the unresolved-module error on.
        const { PrismaLibSQL } = await import(
        // @ts-ignore — optional dependency, installed by consumer
        /* webpackIgnore: true */ /* turbopackIgnore: true */ '@prisma/adapter-libsql');
        const { createClient } = await import(
        // @ts-ignore — optional dependency, installed by consumer
        /* webpackIgnore: true */ /* turbopackIgnore: true */ '@libsql/client');
        const { PrismaClient } = await import(
        // @ts-ignore — generated at build time, resolved outside the bundle graph
        /* webpackIgnore: true */ /* turbopackIgnore: true */ '../../generated/client.js');
        const client = createClient({ url: `file:${filename}` });
        const adapter = new PrismaLibSQL(client);
        return new PrismaClient({ adapter });
    }
    catch {
        throw new Error('SQLite support requires @libsql/client and @prisma/adapter-libsql. ' +
            'Install them with: pnpm add @libsql/client @prisma/adapter-libsql');
    }
}
//# sourceMappingURL=sqlite.js.map