Closed 64J0 closed 8 months ago
Hi @64J0, you can insert more at the same time, but not in a batch manner. But I am open to discussing addition / PR.
The syntax I have in mind:
let listOfPerson : Person list = [personA; personB; personC]
insert {
into personTable
value listOfPerson
}
Where we pass a list of person instead of a single element.
You mean... something like this?
Yes, that is it. I think this is enough to cover my use case. Thanks for sharing it @Dzoukr.
Just to clarify, why you don't consider this approach to be a batch insertion?
Because I am not sure, how it would scale for hundreds of thousands of rows. AFAIK you cannot have more than 1000 rows in a single query it may require splitting before running. But for relatively reasonable numbers it's good enough.
Got it. Thanks for the detailed replies. I'm going to close this issue now.
Description:
Is there any support for batch insert?
I was thinking about passing a sequence of the items to be added to the database instead of a single item.
For instance, I'm looking for a way to replicate this -> https://github.com/andr3marra/rinha-de-backend-2023-q3-csharp/blob/main/src/InsercaoRegistrosPessoas.cs#L54