Replies: 1 comment 2 replies
-
Hi @Niedman 👋 Thank you for raising this question. Currently, to use Defining a View in the schema file and running |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
Hi Everyone,
I've followed the official documentation(https://www.prisma.io/docs/orm/prisma-schema/data-model/views) of Prisma in order to fetch data from a view, however I'm getting
The table public.BalanceTransactionView does not exist in the current database.
If I use $queryraw i'm able to fetch the data and don't get that error but when i use the client like:
prisma.BalanceTransacionView.findMany()
it states that the The table public.BalanceTransactionView does not exist in the current database.I've added the view to the prisma.schema and run prisma generate so I can use the prisma client to the new generated view and I can see that it recognizes it but when i deploy it it just gives the error above. From what i understood from the documentation we don't need to create a migrate so I'm a bit unsure why does it not get the view.
The view on the scheme is defined:
Thanks in advance.
How to reproduce (optional)
Expected behavior (optional)
No response
Information about Prisma Schema, Client Queries and Environment (optional)
// Add your schema.prisma
// Add any relevant Prisma Client queries here
OS:
Database:
Node.js version:
Run
prisma -v
to see your Prisma version and paste itBeta Was this translation helpful? Give feedback.
All reactions