mysql2 driver in edge middleware

Hi all, is it possible to use the mysql2 driver in NextJs edge middleware? I was previously running import { drizzle } from 'drizzle-orm/planetscale-serverless'; which worked great, but i'm now migrating away from planetscale. The problem i'm facing is that when i switch to import { drizzle } from 'drizzle-orm/mysql2'; i get the following error in NextJs: edgeFunction is not a function which suggest that something is relying on a node api somewhere. I'm currently running my db on AWS RDS. Any suggestions how to deal with this? Thanks!
5 Replies
!Stan_---__-
!Stan_---__-8mo ago
bump, facing the exact same issue all the way down to using RDS :/
harshcut
harshcut7mo ago
AFAIK the mysql2 sriver does not support edge runtime yet
Mykhailo
Mykhailo7mo ago
Hey guys. As I know, you can use planetscale driver for any mysql client
harshcut
harshcut7mo ago
even the local mysql server?
Mykhailo
Mykhailo7mo ago
not sure about this
Want results from more Discord servers?
Add your server