You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Golang SQL database driver for [ClickHouse](https://clickhouse.com/).
3
+
Golang SQL database client for [ClickHouse](https://clickhouse.com/).
4
4
5
5
## Versions
6
6
7
-
There are two version of this driver, v1 and v2, available as separate branches.
7
+
There are two version of this client, v1 and v2, available as separate branches.
8
8
9
9
**v1 is now in a state of a maintenance - we will only accept PRs for bug and security fixes.**
10
10
11
11
Users should use v2 which is production ready and [significantly faster than v1](#benchmark).
12
12
13
13
## Supported ClickHouse Versions
14
14
15
-
The driver is tested against the currently [supported versions](https://github.com/ClickHouse/ClickHouse/blob/master/SECURITY.md) of ClickHouse
15
+
The client is tested against the currently [supported versions](https://github.com/ClickHouse/ClickHouse/blob/master/SECURITY.md) of ClickHouse
16
16
17
17
## Supported Golang Versions
18
18
19
-
|Driver Version | Golang Versions |
19
+
|Client Version | Golang Versions |
20
20
|----------------|-----------------|
21
21
| => 2.0 <= 2.2 | 1.17, 1.18 |
22
22
| >= 2.3 | 1.18 |
23
23
24
24
## Key features
25
25
26
-
* Uses ClickHouse native format for optimal performance. Utilises low level [ch-go](https://github.com/ClickHouse/ch-go)driver for encoding/decoding and compression (versions >= 2.3.0).
26
+
* Uses ClickHouse native format for optimal performance. Utilises low level [ch-go](https://github.com/ClickHouse/ch-go)client for encoding/decoding and compression (versions >= 2.3.0).
Compression is supported over http and native. This is performed at a block level and is only used for inserts.
136
+
ZSTD/LZ4 compression is supported over native and http. This is performed at a block level and is only used for inserts.
137
+
138
+
If using `Open` via the std interface and specifying a DSN, compression can be enabled via the `compress` flag. Currently, this is a boolean flag which enables `LZ4` compression.
137
139
138
140
Other compression methods will be added in future PRs.
139
141
140
142
## TLS/SSL
141
143
142
-
At a low level all driver connect methods (DSN/OpenDB/Open) will use the [Go tls package](https://pkg.go.dev/crypto/tls) to establish a secure connection. The driver knows to use TLS if the Options struct contains a non-nil tls.Config pointer.
144
+
At a low level all client connect methods (DSN/OpenDB/Open) will use the [Go tls package](https://pkg.go.dev/crypto/tls) to establish a secure connection. The client knows to use TLS if the Options struct contains a non-nil tls.Config pointer.
143
145
144
146
Setting secure in the DSN creates a minimal tls.Config struct with only the InsecureSkipVerify field set (either true or false). It is equivalent to this code:
145
147
@@ -220,13 +222,13 @@ go get -u github.com/ClickHouse/clickhouse-go/v2
220
222
221
223
## ClickHouse alternatives
222
224
223
-
Versions of this driver>=2.3.x utilise [ch-go](https://github.com/ClickHouse/ch-go) fortheir low level encoding/decoding. This low lever driver provides a high performance columnar interface and should be usedin performance critical use cases. This driver provides more familar row orientated and `database/sql` semantics at the cost of some performance.
225
+
Versions of this client>=2.3.x utilise [ch-go](https://github.com/ClickHouse/ch-go) fortheir low level encoding/decoding. This low lever client provides a high performance columnar interface and should be usedin performance critical use cases. This client provides more familar row orientated and `database/sql` semantics at the cost of some performance.
224
226
225
-
Both drivers are supported by ClickHouse.
227
+
Both clients are supported by ClickHouse.
226
228
227
229
## Third-party alternatives
228
230
229
-
* Database drivers:
231
+
* Database client/clients:
230
232
* [mailru/go-clickhouse](https://github.com/mailru/go-clickhouse) (uses the HTTP protocol)
231
233
* [uptrace/go-clickhouse](https://github.com/uptrace/go-clickhouse) (uses the native TCP protocol with `database/sql`-like API)
0 commit comments