tokio-rs / rdbc

Rust DataBase Connectivity (RDBC) :: Common Rust API for database drivers
Apache License 2.0
569 stars 25 forks source link

Enable Performant Batch Inserts #38

Open jonathanvx opened 4 years ago

jonathanvx commented 4 years ago

Converts many single INSERT statements into one INSERT statement with many values.

Example: INSERT INTO table VALUES (1,'yes'),(2,'no),(3,'maybe'),(4,'not sure')

https://dzone.com/articles/performant-batch-inserts-using-jdbc

https://www.journaldev.com/2494/jdbc-batch-insert-update-mysql-oracle

cfsamson commented 4 years ago

Unless Tiberius (MS-SQL) driver adds native suppurt for batch inserts, I’ve found this method extremely useful to avoid beeing limited to 1000 inserts (which is the case of using INSERT VALUES (), () ...) https://github.com/steffengy/tiberius/issues/93#issuecomment-549096779

Just posting it here for future reference. Tiberius support needs to be implemented first.

wokket commented 4 years ago

I'd love to see support for BULK INSERT, is that the 'batch insert' you're talking about?