xo / usql

Universal command-line interface for SQL databases
MIT License
8.91k stars 351 forks source link

Fixes in \copy implementation for Clickhouse #457

Closed murfffi closed 5 months ago

murfffi commented 5 months ago

A couple of fixes in the Copy function for Clickhouse:

The new automated test fails without the fixes and succeeds with them.

murfffi commented 5 months ago

The automated test could have been either in driver_test.go or in clickhouse_test.go . The copy test in driver_test.go expects destination DB supports RowsAffected but Clickhouse doesn't. So I made a dedicated copy test in clickhouse_test.go. I can implement the other way but the code in drivers_test.go can become convoluted.