One-to-many relation always returning no records for the `many` relation
Hello, I need some help debugging a relation that I have set up for a postgres database. The schema is as follows:
The expected behavior here is to be able to query
flows
{ with: { actions: true }}
and get all Action
records that have the same flowId
as the "parent" Flow
. However, this is not the case:
psql query proving that the expected records do exist:
So what is going on here? Thanks. 5 Replies
I would provide a working drizzle.run for this but for some reason it's not creating the tables. I have to go but here's what I have https://drizzle.run/n2z8f3privcq6y53sv8bfawo
Drizzle Run
undefined - Drizzle Run
Hey 👋
In order to share your playground, you have to enable share (the link you shared is a local only playground 😬).
Sorry if the process was not clear enough.
your issue is here:
the field of
flowActions
is flowActions.flowId
not flowActions.id
oh! thanks so much, I don't know how I didn't see that. and sorry about the playground, oops
No problem, I updated Drizzle Run to add some labels (icons can sometimes not be obvious).