Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create Batch insert?

i just started discovering serviceStack ORMlite , and i am trying to figure out how to do batch inserts. Are there any example of this anywhere ?

Thanks in advance

like image 851
alainb Avatar asked May 10 '26 19:05

alainb


1 Answers

There's currently no built-in support take take advantage of custom RDBMS's support for this feature. E.g. MySQL's Batch Insert support.

The Insert and InsertAll methods in OrmLite do already accept multiple entities, but they're executed individually.

Depending on the database (that support batch insert via SQL) you can execute custom arbitrary SQL by using IDbCommand.ExecuteSql method.

like image 132
mythz Avatar answered May 14 '26 00:05

mythz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!