Im currently migrating from prisma 6 to 7, and I've encountered an issue with raw queries.
I have a nextjs project with a multi-tenant schema, where every customer gets their own schema. They all share the same prisma schema, and to make it work with the cli/client, I have previously provided the schema arg in the connection string (e.g.
? schema=customer_xxx
? schema=customer_xxx
). This has worked just fine for prisma 6.
With prisma 7 I now provide the base db url as connection string to the postgres adapter, and then the desired schema in the second arg of the adapter constructor. This works fine for using the generated model query functions. But if I want to run raw a raw query on a table (e.g. "project"), I will encounter the following issue:
Raw query failed. Code: 42P01. Message: relation "project" does not exist
Raw query failed. Code: 42P01. Message: relation "project" does not exist
If i provide the schema name in the raw query, it will execute. Querying the table via the model's query function will also work as expect. Looking at the query log, I can see that the configured schema name is prefixed to all table names.
Am I correct in my assumption, that I now have to manually add the schema name to every raw statement?