Skip to content

Commit

Permalink
Cleanup examples/std/compression.go (#1036)
Browse files Browse the repository at this point in the history
* chores clean up

* Update examples/std/compression.go

Co-authored-by: Kuba Kaflik <[email protected]>

* Update examples/std/compression.go

---------

Co-authored-by: Kuba Kaflik <[email protected]>
Co-authored-by: Kuba Kaflik <[email protected]>
  • Loading branch information
3 people authored Oct 26, 2023
1 parent 25571c8 commit 3d3d8b3
Showing 1 changed file with 12 additions and 3 deletions.
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

0 comments on commit 3d3d8b3

Please sign in to comment.