export async function createMySQLAdapter(options) {
    try {
        // Optional peer deps resolved lazily at runtime only when MySQL 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 { PrismaMySQL } = await import(
        // @ts-ignore — optional dependency, installed by consumer
        /* webpackIgnore: true */ /* turbopackIgnore: true */ '@prisma/adapter-mysql2');
        const mysql2 = await import(
        // @ts-ignore — optional dependency, installed by consumer
        /* webpackIgnore: true */ /* turbopackIgnore: true */ 'mysql2/promise');
        const { PrismaClient } = await import(
        // @ts-ignore — generated at build time, resolved outside the bundle graph
        /* webpackIgnore: true */ /* turbopackIgnore: true */ '../../generated/client.js');
        const connection = await mysql2.createConnection(options.url);
        const adapter = new PrismaMySQL(connection);
        return new PrismaClient({ adapter });
    }
    catch {
        throw new Error('MySQL support requires mysql2 and @prisma/adapter-mysql2. ' +
            'Install them with: pnpm add mysql2 @prisma/adapter-mysql2');
    }
}
//# sourceMappingURL=mysql.js.map