Hello, I have a question I think about databases i...
# orm-help
j
Hello, I have a question I think about databases in general that I don't understand and I would appreciate if someone could point me somewhere to learn how this aspect of Prisma works. I introspected a Prisma model from a database I already have set up and there are a lot of paired types (which you can also see in the example docs, such as
XOR<UserCreateInput,
UserUncheckedCreateInput>
I'm wondering what the Unchecked means, what the difference between these two types is, and how Prisma decides which one to use when executing a Create mutation.
n
Hey Jeremiah 👋 “Unchecked” input types allow you to perform some operations that are often considered “dangerous”, like directly writing foreign keys. Prisma allows you to choose either a safe or an unchecked input type when doing operations like
create
.
👍 1
j
Sorry, a follow up question. How does Prisma decide which input type is used? The arguments provided?
I figured it out. I was trying to do a nested
connect
from a
create
and was listing two unique properties in the
where
. The error message just didn't make sense to me.
n
Glad to hear that you were able to figure out the solution! 🙌 Thanks for the feedback on the error message, I’ll pass that to the team.