在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ClickHouse/clickhouse-go开源软件地址:https://github.com/ClickHouse/clickhouse-go开源编程语言:Go 98.7%开源软件介绍:ClickHouseGolang SQL database driver for ClickHouse. VersionsThere are two version of this driver, v1 and v2, available as separate branches. v1 is now in a state of a maintenance - we will only accept PRs for bug and security fixes. Users should use v2 which is production ready and significantly faster than v1. Supported ClickHouse VersionsThe driver is tested against the currently supported versions of ClickHouse Key features
Support for the ClickHouse protocol advanced features using
|
V1 (READ) | V2 (READ) std | V2 (READ) native |
---|---|---|
1.218s | 924.390ms | 675.721ms |
V1 (WRITE) | V2 (WRITE) std | V2 (WRITE) native | V2 (WRITE) by column |
---|---|---|---|
1.899s | 1.177s | 699.203ms | 661.973ms |
go get -u github.com/ClickHouse/clickhouse-go/v2
database/sql
interfaceAt a low level all driver connect methods (DSN/OpenDB/Open) will use the Go tls package to establish a secure connection. The driver knows to use TLS if the Options struct contains a non-nil tls.Config pointer.
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:
conn := clickhouse.OpenDB(&clickhouse.Options{
...
TLS: &tls.Config{
InsecureSkipVerify: false
}
...
})
This minimal tls.Config is normally all that is necessary to connect to the secure native port (normally 9440) on a ClickHouse server. If the ClickHouse server does not have a valid certificate (expired, wrong host name, not signed by a publicly recognized root Certificate Authority), InsecureSkipVerify can be to true
, but that is strongly discouraged.
If additional TLS parameters are necessary the application code should set the desired fields in the tls.Config struct. That can include specific cipher suites, forcing a particular TLS version (like 1.2 or 1.3), adding an internal CA certificate chain, adding a client certificate (and private key) if required by the ClickHouse server, and most of the other options that come with a more specialized security setup.
Database drivers:
database/sql
-like API)Insert collectors:
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论