export async function createMySQLAdapter(options) {
    try {
        // @ts-ignore — optional dependency, installed by consumer
        const { PrismaMySQL } = await import('@prisma/adapter-mysql2');
        // @ts-ignore — optional dependency
        const mysql2 = await import('mysql2/promise');
        // @ts-ignore — generated at build time
        const { PrismaClient } = await import('../../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