Skip to content

Cleanup examples/std/compression.go #1036

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

Merged
merged 8 commits into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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