You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to achieve batch insert like in Java or Python.
I see that this is still not after 10 years supported in Go making it slow and insecure (contact of parameters into string making it sql injection prone).
Currently I see a lot of code that contacts strings or sqls with additional parameters.
There is one issue openend in Go but it lacks progress. It saddens me taht such important feature is waiting for more than 10 years. golang/go#5171
However I saw one clever workaround for postgresql using pg.CopyIn that is 2.4 times faster than string values/args aproach that is for now only possible in mysql.
Thank you for reporting. I understand there is a need for this feature.
But I am focusing compression support for now. So please don't write PR until compression is merged.
Issue description
I would like to achieve batch insert like in Java or Python.
I see that this is still not after 10 years supported in Go making it slow and insecure (contact of parameters into string making it sql injection prone).
Currently I see a lot of code that contacts strings or sqls with additional parameters.
Workarounds:
https://stackoverflow.com/questions/12486436/how-do-i-batch-sql-statements-with-package-database-sql
https://gist.github.com/michaelcale/c8bb0c8674f1b1cfbd6dc2029bfe18f4
How to use prepared statements to reduce roundtrips.
https://medium.com/@xuan11290/understand-mysql-prepared-statement-1eb1bda59f7b
There is one issue openend in Go but it lacks progress. It saddens me taht such important feature is waiting for more than 10 years.
golang/go#5171
However I saw one clever workaround for postgresql using pg.CopyIn that is 2.4 times faster than string values/args aproach that is for now only possible in mysql.
Example code
Example code is for java:
I would like to ExecBatch with in one go with one roundtrip.
Error log
Configuration
Driver version (or git SHA): 1.6.0
Go version: 1.22.3
Server version: MySQL 8.0.29
Server OS: Amazon Linux 2023
The text was updated successfully, but these errors were encountered: