Using queryCompiler, PrismaClient doesn't honor Postgres schema from config
I'm attempting to upgrade to the
queryCompiler preview feature and the Postgres adapter. My connectionUrl specifies a Postgres schema (?schema=core), but the PrismaClient throws errors because it "cannot find table public.XXX", implying it does not honor the intended schema value. I have also attempted to provide the schema via the adapter options object, but to no avail.
Has anyone else encountered this issue? Any fixes or workarounds?3 Replies
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into
#ask-ai for a quick spin!I found an open issue about this: https://github.com/prisma/prisma/issues/27037
GitHub
[6.7.0] Schema ignored · Issue #27037 · prisma/prisma
Bug description const adapter = new PrismaPg( { connectionString:
${process.env.DATABASE_URL}, }, { schema: searchPath, } ); trying to set schema like this tried in database_url ?schema and ?sear...It indeed seems like a bug. This is on our ORM team's radar. We plan to fix it soon 🙏