You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in the same transaction, i write to the other tables and joinTables with new methods.
I currently call returning* to get back the primary key
.returning({id: mainItemTable.id});
* (from the docs for sqlite driver. theres another callback called output() but i think thats exclusive to MSSQL?)
however, i dont just want a subset of the saved data. i'd like the full object back with their primary ids in the original structure that it was provided. with a spread operator most likely
performing upsert-read cycles on every item or stitching together the sum of its parts seems like the only way?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Sorry if the title is not clear
Suppose a main item has a 1-to-n or n-to-n relationship with 5-6 other tables
in the same transaction, i write to the other tables and joinTables with new methods.
I currently call returning* to get back the primary key
* (from the docs for sqlite driver. theres another callback called
output()but i think thats exclusive to MSSQL?)however, i dont just want a subset of the saved data. i'd like the full object back with their primary ids in the original structure that it was provided. with a spread operator most likely
performing upsert-read cycles on every item or stitching together the sum of its parts seems like the only way?
please advise
Thank you
Beta Was this translation helpful? Give feedback.
All reactions