Correct way to get data based on email
Hello experimenting with t3-stack,
What would be the correct way to query from my submissions table by checking if an email exists within the table ?
I do not have any submissions at the moment and am expecting it to return null or undefined. but I am instead getting
how can this be if I am expecting to pass in a string (users email)?
Any clarification would be helpful thank you!
3 Replies
adding @unique to the email field seems to have fixed it
if the column need to be unique, you need to add
@id
to specify the table unique identifier
or use @unique
to let prisma know the column will have the unique
contraint
with unique columns, you can use findUnique
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View