SQLStore: Create utility for bulk inserts (#57632)

* Add batchsize to dialects

* Some intermediary progress

* Reflection-based implementation

* Validate batch size

* Implement a few simple tests

* Fix linter error

* Add debug message when falling back to default batch size
This commit is contained in:
Alexander Weaver
2022-11-01 13:24:32 -05:00
committed by GitHub
parent d8a4a7c90d
commit ea8c5ce929
6 changed files with 172 additions and 0 deletions
@@ -40,6 +40,12 @@ func (db *SQLite3) BooleanStr(value bool) string {
return "0"
}
func (db *SQLite3) BatchSize() int {
// SQLite has a maximum parameter count per statement of 100.
// So, we use a small batch size to support write operations.
return 10
}
func (db *SQLite3) DateTimeFunc(value string) string {
return "datetime(" + value + ")"
}