I'm using VS Code with the Prisma extension. I'm a...
# orm-help
l
I'm using VS Code with the Prisma extension. I'm also using Next.js with javascript and not typescript. When I'm doing a CRUD operation it would be handy if a model could be shown in VS Code, so you wouldn't have to lookup your model in the schema, while coding. Can I make it happen with some settings somewhere? Else it's a proposal/feature request from my side to add for the extension or the package. I think it would be very useful
const newOrder = await prisma.Order.create({
data: {
// Hmm... How did the Order model look like again..? Do I really have to go to my schema to view it? can't it be shown in VS code when hovering "Order" or while typing?
},
});
Would you like me to create a feature request of this on github?
n
Hey 👋 You should be getting field names of the order model on pressing
control
+
space
(if using a mac) and equivalent in windows Similar to this, can you check if you get it after pressing control and space key?
l
Oh wow, you are right. Awesome!
Does this also work for a nested model/relation?
Copy code
const newOrder = await prisma.Order.create({
  data: {
    stripe_payment_id: paymentID,
    delivery_address: {
      create: [
        {
          // Hmm.. How did the address model look like?
        }
      ]
    },
  },
});
It would be nice if I didn't have to press ctrl + space. Would be nice if it would just pop up a box while I'm writing or atleast show how a model looks like on hover
n
You should be getting Intellisense on nested relations as well