My application uses gorm to communicate with clickhouse database. The model has nested field. And when the data is inserted, the following query is generated:
INSERT INTO `table1` (`directory`.`id`,`directory`.`type`,`directory`.`path`) VALUES ((?,?),(?,?),(?,?))
But in function extractNormalizedInsertQueryAndColumns i see such column names, because it just trims them
["directory`.`id","directory`.`type","directory`.`path"]
|
columns[i] = strings.Trim(strings.Trim(strings.TrimSpace(columns[i]), "\""), "`") |
As a result in function SortColumns i got error here
missing := difference(b.names, columns)
if len(missing) > 0 {
return fmt.Errorf("block cannot be sorted - missing columns in requested order: %v", missing)
}
Please fix!
My application uses gorm to communicate with clickhouse database. The model has nested field. And when the data is inserted, the following query is generated:
But in function
extractNormalizedInsertQueryAndColumnsi see such column names, because it just trims themclickhouse-go/batch.go
Line 51 in 5bc93d8
As a result in function
SortColumnsi got error herePlease fix!