Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch PostgreSQL schema in a query context #5257

Closed
laspinacristian opened this issue Jan 24, 2021 · 2 comments
Closed

Switch PostgreSQL schema in a query context #5257

laspinacristian opened this issue Jan 24, 2021 · 2 comments

Comments

@laspinacristian
Copy link

Problem

Prisma doesn't give the ability to change Postgres schema in a query context.

I'm developing a SAAS app and I would have liked to use Prisma, but when developing my app I have a lot of tables for each tenant so i use the following postgresql schemas:

  • public: for tables and data related to every tenant
  • tenant1: for tables and data related to tenant1 only
  • tenant2: for tables and data related to tenant2 only
  • tenantN: so on...

So I'm using Knex + Objection.js which give me the ability to select postgres schema in a query context, like so:

const person = await Person.query().withSchema("tenant1").findById(1);

Is there something am I missing in the prisma docs or was this feature already discussed?

@laspinacristian laspinacristian changed the title Give Switch postgresql schema in a query context Jan 24, 2021
@pantharshit00 pantharshit00 added kind/feature A request for a new feature. team/client Issue for team Client. topic: postgresql labels Jan 27, 2021
@pantharshit00
Copy link
Contributor

Related: #1122

@janpio janpio changed the title Switch postgresql schema in a query context Switch PostgreSQL schema in a query context Jun 17, 2023
@janpio
Copy link
Member

janpio commented Jun 17, 2023

I think this is effectively a duplicate of #12420 - hence closing the issue.

@janpio janpio closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants