Skip to content

Commit ade1343

Browse files
authored
Merge pull request ClickHouse#418 from vladdoster/patch-1
(docs): update README.md
2 parents c47e24b + b705ba5 commit ade1343

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

README.md

+19-15
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Golang SQL database driver for [Yandex ClickHouse](https://clickhouse.yandex/)
44

55
## Key features
66

7-
* Uses native ClickHouse tcp client-server protocol
7+
* Uses native ClickHouse TCP client-server protocol
88
* Compatibility with `database/sql`
99
* Round Robin load-balancing
1010
* Bulk write support : `begin->prepare->(in loop exec)->commit`
11-
* LZ4 compression support (default to use pure go lz4, switch to use cgo lz4 by turn clz4 build tags on)
11+
* LZ4 compression support (default is pure go lz4 or switch to use cgo lz4 by turning clz4 build tags on)
1212
* External Tables support
1313

1414
## DSN
@@ -17,13 +17,13 @@ Golang SQL database driver for [Yandex ClickHouse](https://clickhouse.yandex/)
1717
* database - select the current default database
1818
* read_timeout/write_timeout - timeout in second
1919
* no_delay - disable/enable the Nagle Algorithm for tcp socket (default is 'true' - disable)
20-
* alt_hosts - comma separated list of single address host for load-balancing
20+
* alt_hosts - comma-separated list of single address hosts for load-balancing
2121
* connection_open_strategy - random/in_order (default random).
22-
* random - choose random server from set
23-
* in_order - first live server is choosen in specified order
24-
* time_random - choose random(based on current time) server from set. This option differs from `random` in that randomness is based on current time rather than on amount of previous connections.
25-
* block_size - maximum rows in block (default is 1000000). If the rows are larger then the data will be split into several blocks to send them to the server. If one block was sent to the server, the data will be persisted on the server disk, we can't rollback the transaction. So always keep in mind that the batch size no larger than the block_size if you want atomic batch insert.
26-
* pool_size - maximum amount of preallocated byte chunks used in queries (default is 100). Decrease this if you experience memory problems at the expense of more GC pressure and vice versa.
22+
* random - choose a random server from the set
23+
* in_order - first live server is chosen in specified order
24+
* time_random - choose random (based on the current time) server from the set. This option differs from `random` because randomness is based on the current time rather than on the number of previous connections.
25+
* block_size - maximum rows in block (default is 1000000). If the rows are larger, the data will be split into several blocks to send to the server. If one block was sent to the server, the data would be persisted on the server disk, and we can't roll back the transaction. So always keep in mind that the batch size is no larger than the block_size if you want an atomic batch insert.
26+
* pool_size - the maximum amount of preallocated byte chunks used in queries (default is 100). Decrease this if you experience memory problems at the expense of more GC pressure and vice versa.
2727
* debug - enable debug output (boolean value)
2828
* compress - enable lz4 compression (integer value, default is '0')
2929

@@ -33,8 +33,9 @@ SSL/TLS parameters:
3333
* skip_verify - skip certificate verification (default is false)
3434
* tls_config - name of a TLS config with client certificates, registered using `clickhouse.RegisterTLSConfig()`; implies secure to be true, unless explicitly specified
3535

36-
example:
37-
```
36+
Example:
37+
38+
```sh
3839
tcp://host1:9000?username=user&password=qwerty&database=clicks&read_timeout=10&write_timeout=20&alt_hosts=host2:9000,host3:9000
3940
```
4041

@@ -60,11 +61,13 @@ tcp://host1:9000?username=user&password=qwerty&database=clicks&read_timeout=10&w
6061
* Support other compression methods(zstd ...)
6162

6263
## Install
63-
```
64+
65+
```sh
6466
go get -u github.com/ClickHouse/clickhouse-go
6567
```
6668

67-
## Example
69+
## Examples
70+
6871
```go
6972
package main
7073

@@ -157,7 +160,7 @@ func main() {
157160
}
158161
```
159162

160-
Use [sqlx](https://github.com/jmoiron/sqlx)
163+
### Use [sqlx](https://github.com/jmoiron/sqlx)
161164

162165
```go
163166
package main
@@ -193,7 +196,8 @@ func main() {
193196
}
194197
```
195198

196-
External tables support
199+
### External tables support
200+
197201
```go
198202
package main
199203

@@ -299,4 +303,4 @@ func main() {
299303
log.Fatal(err)
300304
}
301305
}
302-
```
306+
```

0 commit comments

Comments
 (0)