Skip to content

Commit 7adac98

Browse files
Merge branch 'main' into feat/ssh
2 parents 43bdf8f + 2482bad commit 7adac98

File tree

1 file changed

+47
-10
lines changed

1 file changed

+47
-10
lines changed

README.md

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,27 +150,64 @@ conn.SetConnMaxLifetime(time.Hour)
150150
* round_robin - choose a round-robin server from the set
151151
* in_order - first live server is chosen in specified order
152152
* debug - enable debug output (boolean value)
153-
* compress - compress - specify the compression algorithm - “none” (default), `zstd`, `lz4`, `gzip`, `deflate`, `br`. If set to `true`, `lz4` will be used.
154-
* compress_level - Level of compression (default is 0). This is algorithm specific:
155-
- `gzip` - `-2` (Best Speed) to `9` (Best Compression)
156-
- `deflate` - `-2` (Best Speed) to `9` (Best Compression)
157-
- `br` - `0` (Best Speed) to `11` (Best Compression)
158-
- `zstd`, `lz4` - ignored
153+
* compress - specify the compression algorithm: `none` (default), `zstd`, `lz4`, `lz4hc`, `gzip`, `deflate`, `br`. If set to `true`, `lz4` will be used.
154+
* compress_level - Level of compression (algorithm-specific, default is 3 when compression is enabled):
155+
- `gzip`/`deflate`: `-2` (Best Speed) to `9` (Best Compression)
156+
- `br`: `0` (Best Speed) to `11` (Best Compression)
157+
- `zstd`/`lz4`/`lz4hc`: ignored
159158
* block_buffer_size - size of block buffer (default 2)
160159
* read_timeout - a duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix such as "300ms", "1s". Valid time units are "ms", "s", "m" (default 5m).
161160
* max_compression_buffer - max size (bytes) of compression buffer during column by column compression (default 10MiB)
162161
* client_info_product - optional list (comma separated) of product name and version pair separated with `/`. This value will be pass a part of client info. e.g. `client_info_product=my_app/1.0,my_module/0.1` More details in [Client info](#client-info) section.
163162
* http_proxy - HTTP proxy address
164163

165-
SSL/TLS parameters:
164+
## Connection Settings Reference
166165

167-
* secure - establish secure connection (default is false)
168-
* skip_verify - skip certificate verification (default is false)
166+
The following connection settings are available in both DSN strings and the `clickhouse.Options` struct:
167+
168+
### Timeout Settings
169+
* **dial_timeout** - Connection timeout for establishing a connection to the server (default: 30s)
170+
* **read_timeout** - Timeout for reading server responses (default: 5m)
171+
172+
### Connection Pool Settings
173+
* **max_open_conns** - Maximum number of open connections to the database (default: MaxIdleConns + 5)
174+
* **max_idle_conns** - Maximum number of idle connections in the pool (default: 5)
175+
* **conn_max_lifetime** - Maximum amount of time a connection may be reused (default: 1h)
176+
177+
### Connection Strategy
178+
* **connection_open_strategy** - Strategy for selecting servers from the connection pool:
179+
* `in_order` - Choose the first available server in the specified order (default)
180+
* `round_robin` - Choose servers in a round-robin fashion
181+
* `random` - Choose a random server from the pool
182+
183+
### Compression Settings
184+
* **compress** - Enable compression with a specific algorithm: `none`, `zstd`, `lz4`, `lz4hc`, `gzip`, `deflate`, `br`. If set to `true`, `lz4` will be used (default: `none`)
185+
* **compress_level** - Compression level (algorithm-specific):
186+
* `gzip`/`deflate`: `-2` (Best Speed) to `9` (Best Compression)
187+
* `br`: `0` (Best Speed) to `11` (Best Compression)
188+
* `zstd`/`lz4`: ignored
189+
* **max_compression_buffer** - Maximum size of compression buffer in bytes (default: 10MiB)
190+
191+
### Buffer Settings
192+
* **block_buffer_size** - Size of block buffer (default: 2)
193+
194+
### Debug Settings
195+
* **debug** - Enable debug output (boolean value)
196+
197+
### SSL/TLS Settings
198+
* **secure** - Establish secure connection (default: false)
199+
* **skip_verify** - Skip certificate verification (default: false)
200+
201+
### Client Information
202+
* **client_info_product** - Comma-separated list of product name and version pairs (e.g., `my_app/1.0,my_module/0.1`)
203+
204+
### HTTP Settings
205+
* **http_proxy** - HTTP proxy address for HTTP protocol connections
169206

170207
Example:
171208

172209
```sh
173-
clickhouse://username:password@host1:9000,host2:9000/database?dial_timeout=200ms&max_execution_time=60
210+
clickhouse://username:password@host1:9000,host2:9000/database?dial_timeout=200ms&read_timeout=30s&max_execution_time=60
174211
```
175212

176213
### HTTP Support (Experimental)

0 commit comments

Comments
 (0)