is it possible to insert a row with just one call ...
# help
j
is it possible to insert a row with just one call without the need to use “remote procedure call” when you need to fetch the right foreign key id first ? I have multiple foreign key so it will mean one additional call for each fk.
s
It's not very clear if you are asking about inserting into multiple tables or inserting in one table?
j
in one table
but i need data from another table first
in psql it will be somethings like that
INSERT INTO bar (description, foo_id) VALUES ( 'testing', (SELECT id from foo WHERE type='blue') ) );
s
I don't think this can be done from the supabas-js library without a rpc call
j
yeah , i will need to learn psql 😄
thx for the help )