From 883c82ba3b230d9d43ccd2bc35ddf5fb98349fda Mon Sep 17 00:00:00 2001 From: Caleb Xiang Date: Mon, 24 Jul 2023 13:18:14 +0800 Subject: [PATCH 1/3] chores clean up --- examples/std/compression.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/examples/std/compression.go b/examples/std/compression.go index bab38cd486..13da43db54 100644 --- a/examples/std/compression.go +++ b/examples/std/compression.go @@ -20,8 +20,9 @@ package std import ( "database/sql" "fmt" - "github.com/ClickHouse/clickhouse-go/v2" "strconv" + + "github.com/ClickHouse/clickhouse-go/v2" ) func CompressOpenDB() error { @@ -49,6 +50,7 @@ func CompressOpenDB() error { if _, err := conn.Exec(` CREATE TABLE example ( Col1 Array(String) + , Col2 Uint64 ) Engine Memory `); err != nil { return err @@ -61,11 +63,11 @@ func CompressOpenDB() error { if err != nil { return err } - if err != nil { - return err - } for i := 0; i < 1000; i++ { - if _, err := batch.Exec([]string{strconv.Itoa(i), strconv.Itoa(i + 1), strconv.Itoa(i + 2), strconv.Itoa(i + 3)}); err != nil { + if _, err := batch.Exec( + []string{strconv.Itoa(i), strconv.Itoa(i + 1), strconv.Itoa(i + 2), strconv.Itoa(i + 3)}, + uint64(i), + ); err != nil { return err } } @@ -89,6 +91,7 @@ func CompressOpen() error { if _, err := conn.Exec(` CREATE TABLE example ( Col1 Array(String) + , Col2 Uint64 ) Engine Memory `); err != nil { return err @@ -101,11 +104,11 @@ func CompressOpen() error { if err != nil { return err } - if err != nil { - return err - } for i := 0; i < 1000; i++ { - if _, err := batch.Exec([]string{strconv.Itoa(i), strconv.Itoa(i + 1), strconv.Itoa(i + 2), strconv.Itoa(i + 3)}); err != nil { + if _, err := batch.Exec( + []string{strconv.Itoa(i), strconv.Itoa(i + 1), strconv.Itoa(i + 2), strconv.Itoa(i + 3)}, + uint64(i), + ); err != nil { return err } } From 3b191bdb958afb4d615b21e6d72f78800f5db800 Mon Sep 17 00:00:00 2001 From: "caleb.xiang" <90543061+cxiang03@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:36:39 +0800 Subject: [PATCH 2/3] Update examples/std/compression.go Co-authored-by: Kuba Kaflik --- examples/std/compression.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/std/compression.go b/examples/std/compression.go index 13da43db54..6230ade1f5 100644 --- a/examples/std/compression.go +++ b/examples/std/compression.go @@ -91,7 +91,7 @@ func CompressOpen() error { if _, err := conn.Exec(` CREATE TABLE example ( Col1 Array(String) - , Col2 Uint64 + , Col2 UInt64 ) Engine Memory `); err != nil { return err From 62b7700db3dfb7f1a4adcd953e307441cc7d5498 Mon Sep 17 00:00:00 2001 From: "caleb.xiang" <90543061+cxiang03@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:40:24 +0800 Subject: [PATCH 3/3] Update examples/std/compression.go --- examples/std/compression.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/std/compression.go b/examples/std/compression.go index 6230ade1f5..6448cff743 100644 --- a/examples/std/compression.go +++ b/examples/std/compression.go @@ -50,7 +50,7 @@ func CompressOpenDB() error { if _, err := conn.Exec(` CREATE TABLE example ( Col1 Array(String) - , Col2 Uint64 + , Col2 UInt64 ) Engine Memory `); err != nil { return err