This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "github.com/ClickHouse/clickhouse-go/v2" | |
| ) | |
| func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func main() { | |
| conn, err := clickhouse.Open(&clickhouse.Options{ | |
| Addr: []string{ | |
| "127.0.0.1:9000", | |
| }, | |
| }) | |
| create := ` | |
| CREATE OR REPLACE TABLE test_json ( | |
| id Int, | |
| data String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package code | |
| import ( | |
| "testing" | |
| "time" | |
| "github.com/ClickHouse/clickhouse-go/v2" | |
| ) | |
| func TestClientLB(t *testing.T) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "crypto/tls" | |
| "database/sql" | |
| "fmt" | |
| "github.com/ClickHouse/clickhouse-go/v2" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "os" | |
| "github.com/ClickHouse/clickhouse-go/v2" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "github.com/ClickHouse/ch-go" | |
| "github.com/ClickHouse/ch-go/proto" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "github.com/ClickHouse/clickhouse-go/v2" | |
| ) | |
| func main() { | |
| conn, err := clickhouse.Open(&clickhouse.Options{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "io" | |
| "net/http" | |
| "os" | |
| "strings" | |
| "time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package code | |
| import ( | |
| "context" | |
| "testing" | |
| "time" | |
| "github.com/ClickHouse/clickhouse-go/v2" | |
| "github.com/stretchr/testify/require" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func TestWithStdAsync(t *testing.T) { | |
| conn, err := clickhouse.Open(&clickhouse.Options{ | |
| Addr: []string{"localhost:9000"}, | |
| Protocol: clickhouse.Native, | |
| }) | |
| require.NoError(t, err) | |
| ctx := context.Background() | |
| queryID := fmt.Sprintf("%d", time.Now().Unix()) | |
| // queryID := "async-with-opendb" |
NewerOlder