gocraft/dbr

Bulk insert records into clickhouse

asfaltboy opened this issue · 1 comments

Hi, thanks for the great library! I currently have this sort of insert done one by one from a struct record:

clickhouse, _ := dbr.Open("clickhouse", clickhouseDSN, nil)
session := client.NewSession(nil)
session.InsertInto(tableName)
	.Columns(columns...)
	.Record(row)

As you may know, clickhouse is notoriously bad with single inserts, and bulk insert is recommended. But I cannot figure out how to do it with dbr (chaining another .Record(row) call does not work).

I would rather avoid using: https://github.com/nikepan/clickhouse-bulk . Is there any way I can batch up multiple record values?

wrong repo sorry