Can relations be used with insert
or returning
?
#2317
Replies: 2 comments
-
Related, I'd like to return related tables after an insert or update to avoid multiple requests. Is this possible? I was able to do this using the Supabase JavaScript API although I'm not sure if that was implemented as two requests under the covers, e.g.
|
Beta Was this translation helpful? Give feedback.
-
Maybe something like subquery can helps? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Drizzle supports including relations when querying data.
But how does this work with
insert
andreturning
?For example:
I insert a
post
which has aforum_id
. Instead of passing theforum_id
I want to pass theforum_name
(which is unique) and implies theforum_id
. Theforum_name
is only present in theforum
-table.Beta Was this translation helpful? Give feedback.
All reactions