Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup examples/std/compression.go #1036

Merged
merged 8 commits into from
Oct 26, 2023
15 changes: 12 additions & 3 deletions examples/std/compression.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -62,7 +64,10 @@ func CompressOpenDB() error {
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
}
}
Expand All @@ -86,6 +91,7 @@ func CompressOpen() error {
if _, err := conn.Exec(`
CREATE TABLE example (
Col1 Array(String)
, Col2 UInt64
) Engine Memory
`); err != nil {
return err
Expand All @@ -99,7 +105,10 @@ func CompressOpen() error {
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
}
}
Expand Down
Loading