P
Prisma•7mo ago
Anonymous

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
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
Anonymous
Anonymous•7mo ago
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
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
Nurul
Nurul•7mo ago
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...
Anonymous
Anonymous•7mo ago
ok, thanks for clarify
Nurul
Nurul•7mo ago
No worries 🙂
roobr
roobr•5mo ago
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
const authUsers = await prisma.auth.user.findMany()

// Query the user table in the public schema
const publicUsers = await prisma.public.user.findMany()
const authUsers = await prisma.auth.user.findMany()

// Query the user table in the public schema
const publicUsers = await prisma.public.user.findMany()
Nurul
Nurul•5mo ago
What error are you getting?
Want results from more Discord servers?
Add your server