Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Better support for Postgres Schemas #66

Closed
jimsimon opened this issue Oct 18, 2020 · 2 comments
Closed

Better support for Postgres Schemas #66

jimsimon opened this issue Oct 18, 2020 · 2 comments

Comments

@jimsimon
Copy link

jimsimon commented Oct 18, 2020

This is similar to #40 but would be tailored to Postgres specifically. The idea would be to leverage SET schema or SET search_path inside of a PrismaClient middleware. The tenant model would need a schema property, and ideally this would support creating/using a different user per schema for improved data isolation and security.

Right now we can use Postgres schemas via different connection urls, but I suspect that's also spinning up a separate connection pool per schema which can be mitigated by leveraging SET schema.

@jimsimon
Copy link
Author

Nevermind, I don't believe this is possible with the current middleware support. I've opened prisma/prisma#3968. Hopefully they'll support it or provide an alternative workaround.

@Errorname
Copy link
Owner

Hi @jimsimon! This sounds indeed like a good idea, but I don't think it's possible with the current capabilities of Prisma at the moment. I'll close this issue for now, but don't hesitate to reopen, or create a new one, if it becomes possible in the future.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants