Most databases support multi-row INSERT statements so
it is possible to speed up \copy by using batches. This issue is discussed in the PR for Clickhouse \copy implementation -
https://github.com/xo/usql/pull/457 .
Specifically, Clickhouse doesn't benefit from multi-row inserts within a Go SQL transaction, because the Clickhouse driver implements the Go transactions as batches anyway. All INSERTs in a transactions are written as a single batch always. Furthermore, the Clickhouse Go driver doesn't seem to support including multiple rows in an Exec on a prepared statement within a transaction/batch.
Still this feature can be implemented for other DBs.
Most databases support multi-row INSERT statements so it is possible to speed up \copy by using batches. This issue is discussed in the PR for Clickhouse \copy implementation - https://github.com/xo/usql/pull/457 .
Specifically, Clickhouse doesn't benefit from multi-row inserts within a Go SQL transaction, because the Clickhouse driver implements the Go transactions as batches anyway. All INSERTs in a transactions are written as a single batch always. Furthermore, the Clickhouse Go driver doesn't seem to support including multiple rows in an Exec on a prepared statement within a transaction/batch.
Still this feature can be implemented for other DBs.