Hi all, Regarding the Prisma multi schema feature,...
# orm-help
s
Hi all, Regarding the Prisma multi schema feature, As I understand it, duplicate table names across schemas isn’t supported at the moment. Would you be able to provide an ETA on that? We are currently conducting a POC for several ORMs and I would like to try Prisma as one of our options Thanks!
1
n
Hey Shaked 👋 nice to hear you’re considering Prisma! I’m double-checking this with the Engineering team but I believe this should already be possible today by using the
@@map
attribute on your Prisma models. That way, you can have the same table name in two different schemas but can use different names in your Prisma models. For example a table called
User
in two schemas called
schema1
and `schema2`:
Copy code
model User1 {
  id Int @id
  ...
  @@map("User")
  @@schema("schema1")
}

model User2 {
  id Int @id
  ...
  @@map("User")
  @@schema("schema2")
}
Ah, just heard back that this kind of schema would currently fail during validation 😅 so you’re right this wouldn’t work yet!
I don’t have an ETA unfortunately but I would expect this to arrive it not too far distant future since it seems like a pretty crucial piece of functionality for multi-schema support.
(Just heard that it’s not going to make it in the next release but it’s likely to become available in v4.5.0)
s
@nikolasburk Thank you very much!
🙏 1