multiSchema variable
Hi all, im trying to use .env to replace schemas value
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
schemas = ["base", "transactional"]
}
change to
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
schemas = [env("db")]
}
but i got the error Expected a string value, but received functional value
env("db").
any idea for this?8 Replies
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
issue in file structure? any more details on that?
cause i using string for schema is working, thinking anyway to change it to dynamic
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
Hey @kmj 👋
What you are trying to do is not supported at the moment.
Please refer to this feature request:
https://github.com/prisma/prisma/issues/15089
GitHub
Multischema configuration does not support environment variables · ...
When attempting to use an environment variable to configure the schemas array in the datasource, OR the @@Schema for models, the following error occurs: Environment variables loaded from .env Prism...
ok, thanks for clarify
No worries 🙂
Hello, It looks like this is a preview feature but I cant seem to get it working, any pointers? I have enabled it in my prisma.schema but the client wont let me access seperate schemas, it looks like the prisma db pull just renames if there is a clash
I am trying to do const authUsers = await prisma.auth.user.findMany()
// Query the user table in the public schema
const publicUsers = await prisma.public.user.findMany()
I am trying to do
What error are you getting?