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
define a script in your package.json and just call that?
I agree, you should create a command in package.json to avoid passing the --schema paramater everytime.
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="
Is MySQL and Postgres that far apart to use two db's?
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
Omph, gotta love bolting things on after the fact
Any suggestions?
No, but you could use Hasura to stitch those two databases into one GraphQL api
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.
I apparently only code startups, so I live in a world of duct tape and pray for bolts lol