Getting error while using Drizzle with MySQL2
I am following this guide: https://orm.drizzle.team/docs/get-started-mysql#mysql-2
My setup:
- Fork of
create-t3-turbo
: https://github.com/t3-oss/create-t3-turbo
- Trying to replace planetscale
with "local docker mysql"
Using below code for drizze:
Getting below error:
GitHub
GitHub - t3-oss/create-t3-turbo: Clean and simple starter repo usin...
Clean and simple starter repo using the T3 Stack along with Expo React Native - GitHub - t3-oss/create-t3-turbo: Clean and simple starter repo using the T3 Stack along with Expo React Native
Drizzle ORM - next gen TypeScript ORM
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
6 Replies
You might be trying to do database call in the client?
I am not sure, I am just using the t3-turbo stack, and it's using nextjs
it should be smart-enough to figure out that it should run on server side, no?
@Angelelz
You might need to set up MySQL2 as external package in nextjs config
Or something like that, I don't remember
I did that for my
db
package
That error is gone now,
But getting new error now:
Full stacktrace:
Able to resolve it, I had to do pnpm i
again at the root, and start the project again.
now I am getting this error
You have to tell MySQL2 what database to query
yes just figured it out, added
database
field in ConnectionOptions
Thanks for the help.