Hi All, Want to ask, actually right now I have a ...
# orm-help
d
Hi All, Want to ask, actually right now I have a view in MySQL. And trying to add it to Prisma’s Schema so I can fetch data from there. But there is a problem, why it’s will create a new table under that View’s name when I run migrate command? I am using Prisma with NexusJS. Anyone can help me? very confused right now.
r
@David 👋 Unfortunately Views are not yet supported in Prisma. I would suggest adding a 👍 to this request so that we can set the priority for this. As a workaround, you could create the view with Migrate and then use raw queries to fetch data from the view.
d
Hi @Ryan, Thanks a lot for your response, I see, so for my case it’s either doing the raw queries thing or just create data relationship from scratch in my BE (in this case NexusJS / GraphQL) ?
Btw, I up-voted issue #678.
👍 1
r
Yes you would need to create the object for the view in Nexus. As views are read-only, you would just need a
Query
type for the same.
🙌 1
d
I see, got it Ryan, thanks for the advice and input. Will try it as a solution. 🍻
💯 1