P
Prisma6mo ago
Amauri

Help With 2 database usage in same api

hey guys what's up? i have a project running with postgresql, but in the same application i also have to run mysql on some occasions. I have already configured the connections and everything is ok. my question is, is there any way in the CLI to avoid having to put --schema=./prisma/schema-postgresql.prisma at the end when executing any command? I'm thinking something like yarn prisma generate --mysql
10 Replies
Up
Up6mo ago
define a script in your package.json and just call that?
Nurul
Nurul6mo ago
I agree, you should create a command in package.json to avoid passing the --schema paramater everytime.
Amauri
AmauriOP5mo ago
this way I would have to create a script in package.json for each prisma command, my intention was to use prisma normally just by setting a flag -- without creating a prisma:dbpush in the package: "prisma db push --schema="
Yetzederixx
Yetzederixx5mo ago
Is MySQL and Postgres that far apart to use two db's?
Amauri
AmauriOP5mo ago
Contextualizing: I set up a structure consulting data from a cloud api, which is consulted by a power BI, this BI is already mounted on the structure I set up in postgresql, and now there has been a change in scope, where I no longer search for data from an online api, but from a mysql bank, and in order not to have the effort to change the power bi, or create the postgres structure in mysql, I thought of changing the query methods to directly in the bank and feed the structure already used by BI
Yetzederixx
Yetzederixx5mo ago
Omph, gotta love bolting things on after the fact
Amauri
AmauriOP5mo ago
Any suggestions?
Yetzederixx
Yetzederixx5mo ago
No, but you could use Hasura to stitch those two databases into one GraphQL api
Yetzederixx
Yetzederixx5mo ago
Instant GraphQL APIs on your data | Built-in Authz & Caching
Hasura gives you instant GraphQL and REST APIs on new and existing data sources. Connect Hasura to your data & get APIs in under a minute.
Yetzederixx
Yetzederixx5mo ago
I apparently only code startups, so I live in a world of duct tape and pray for bolts lol
Want results from more Discord servers?
Add your server