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
* round_robin - choose a round-robin server from the set
151
151
* in_order - first live server is chosen in specified order
152
152
* 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
159
158
* block_buffer_size - size of block buffer (default 2)
160
159
* 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).
161
160
* max_compression_buffer - max size (bytes) of compression buffer during column by column compression (default 10MiB)
162
161
* 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.
163
162
* http_proxy - HTTP proxy address
164
163
165
-
SSL/TLS parameters:
164
+
## Connection Settings Reference
166
165
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`)
0 commit comments