Closed phil-schreiber closed 2 months ago
AppendRow and insert succeeds
package main import ( "context" "fmt" "github.com/ClickHouse/clickhouse-go/v2" ) func main() { conn, _ := clickhouse.Open(&clickhouse.Options{ Protocol: clickhouse.Native, Addr: []string{fmt.Sprintf("%s:%d", "127.0.0.1", 9001)}, Auth: clickhouse.Auth{ Database: "default", Username: "admin", Password: "123", }, }) conn.Exec(context.Background(), "CREATE TABLE IF NOT EXISTS default.array_test (Col1 Array(Array(String))) Engine = Memory") strings := []string{"foo", "bar"} stringsWorking := [][]string{strings} var insertValue []interface{} insertValue = append(insertValue, strings) batch, err := conn.PrepareBatch(context.Background(), "INSERT INTO default.array_test Col1 VALUES (?)") if err != nil { panic(err) } err = batch.Append(stringsWorking) if err != nil { panic(err) } // This fails !!! err = batch.Append(insertValue) if err != nil { panic(err) } }
clickhouse [AppendRow]: converting reflect.Value to Array is unsupported
clickhouse-go
Observed
Expected behaviour
AppendRow and insert succeeds
Code example
Error log
Details
Environment
clickhouse-go
version: v2.26.0