Skip to content

How to insert data with foreign key? #1683

Answered by simolus3
jack24254029 asked this question in Q&A
Discussion options

You must be logged in to vote

I would probably go for approach number 1, perhaps in a transaction if you care about atomicity.

Approach 2 is not more efficient (any positive effect Future.wait may have is cancelled out because you still have to run a query afterwards). And IMO approach 1 is more readable.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jack24254029
Comment options

Answer selected by jack24254029
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants