I'd like to use two different Prisma databases in one project. This is currently not possible, because of:
[ ] The logic used to find the project in .graphqlconfig. This needs to be updated to look for the same prisma.yml file that is used for the deployment.
[ ] The logic the CLI uses to find the prisma.yml. If I want to deploy either one of my projects, I should run the prisma deploy
command from the subfolder with the prisma.yml for that service.
So given the following folder structure:
|- db1
| |- prisma.yml
|- db2
| |- prisma.yml
And the following .graphqlconfig:
projects:
myFirstService:
schemaPath: 'src/generated/db1.graphql
extensions:
prisma: db1/prisma.yml
mySecondService:
schemaPath: 'src/generated/db2.graphql
extensions:
prisma: db2/prisma.yml
Note that in this example, I deliberately used different project names. If it's easier to implement by using the convention 'project name == folder name' (so a project db1 always lives in the db1 folder), that's also fine with me.
We will be thinking a lot more about this over the coming weeks. My thinking so far has been that one service would be able to connect to multiple underlying databases. Just to spell it out super clear - what benefits do you see in supporting multiple services instead of one service with multiple underlying databases?
Given two teams maintaining their own GraphQL endpoint based on Prisma, and I'm building a public facing something that uses both.
Having one service connect to two databases is a different use case. It requires me to be 'in control' of the service schema, and literally use two databases. The other use case is more high level.
We'd love this too!
I updated the original post to use new terminology.
+1. Would also really love this.
Any progress?
Any way I can help get this implemented?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.
+1
My team would love this as well. We need to be able to look across different databases AND schemas in PostgreSQL. Due to compliance constraints, we need to be able to separate customer data. To be clear, the actual Database Schema is the same across all DBs, just the storage is different. I'm sure more and more people are going to run into multi-tenancy issues so would love to get your guys thoughts on where prisma is at with this on the roadmap.
Is there any workaround for this? We have several mongo databases and it would be helpful for using graphql as a gateway
@yussinsharp We have the same stipulation and therefore can't seem to use Prisma as having a Prisma server per Postgres Schema is not an option. Did you find a solution so far for this?
Can't wait to get this implemented in my project. It'll be great if such feature would exist in Prisma.
I also have multiple schemas on one DB, and would like to access them all from one Prisma install. Having a Prisma install for each Schema is very much overkill.
Most helpful comment
+1. Would also really love this.
Any progress?