having trouble to include relations with query function
how do you exactly use the
with
field in the query options to include relations ?, my functions always returned referencedTable
error
my relation is declared like the following
and here's the query
i've also tried to change the with
object to {users:true}
but still receiving the referencedTable
error3 Replies
am i missing something, is this relation variable should be assigned somewhere ?
turns out yes it's, I didn't include the relation when creating the drizzle instance
why do you reference
createdAt
in the relation? Do you use it as your primary key? If yes, then it's wrong, you should use id instead. Also, after you fixed it, how does your correct schema now looks like?Yea i have same issue like this in https://discord.com/channels/1043890932593987624/1219061432860278784