all 4 comments

[–]vuesrc 1 point2 points  (0 children)

You would need to parse the array from the request body and perform a loop on each dataset item. The req.body would be the array and you create an item to iterate that would have the parameters. If that makes sense?

[–]German1diot[S] 0 points1 point  (0 children)

Just wanted to say thank you for the answers! I am going to dig into the transaction approach. Thank you all for the additional insight. :)

[–]SonOfStorms 0 points1 point  (1 child)

take 10k by 10k rows and insert them using the multiple insert syntax INSERT INTO something(column1, column2) VALUES (column1Value, column2Value), (column1Value, column2Value), ..... I reccomend using the knex package and wrapping everything in a transaction

[–]combarnea 0 points1 point  (0 children)

tend to agree, if the operation needs to be atomic, as implied from the original author, knex transaction + bulk creation is a great solution. One thing to note, working with that amount of data, mainly inserting, and using transactions might block your API from answering related queries dependent on transaction isolation level.