DT
Drizzle Team•10mo ago
ewert

Drizzle multi databse config (MySQL)

Hey! I need to use drizzle on a new product, which also access a legacy database. I would like to use Drizzle for multiple database connections (MySQL), along with drizzle kit. (like two database_url s) Is it possible? and if yes how? Also is it possible somehow to mix db engines? Like one config for MySQL and one for Postges? Both working with drizzle-kit?
2 Replies
ewert
ewertOP•10mo ago
Can someone help? 🫠
piechart
piechart•10mo ago
For drizzle-orm you'd have to instantiate two separate db objects and pass the correct db object as an argument to your functions if you want to reuse the same query logic. For drizzle-kit it should be possible too, with separate schemas and two separate config.ts files. You can specify the one to use with each command with --config
Want results from more Discord servers?
Add your server