|
@@ -18,11 +18,7 @@ type _ch struct {
|
|
|
}
|
|
|
|
|
|
//goland:noinspection GoUnusedExportedFunction
|
|
|
-func NewClickhouse(cfg *Config, debug bool) (Database[driver.Rows, driver.Batch], error) {
|
|
|
- if cfg == nil || cfg.Clickhouse == nil {
|
|
|
- return nil, fmt.Errorf("illegal state: `*config.ClickhouseConfig` is nil")
|
|
|
- }
|
|
|
-
|
|
|
+func NewClickhouse(cfg Config, debug bool) (Database[driver.Rows, driver.Batch], error) {
|
|
|
var tlcConfig *tls.Config
|
|
|
if cfg.Clickhouse.Params.Secure {
|
|
|
tlcConfig = &tls.Config{
|
|
@@ -53,7 +49,7 @@ func NewClickhouse(cfg *Config, debug bool) (Database[driver.Rows, driver.Batch]
|
|
|
}
|
|
|
|
|
|
s := &_ch{
|
|
|
- config: cfg.Clickhouse,
|
|
|
+ config: &cfg.Clickhouse,
|
|
|
conn: session,
|
|
|
}
|
|
|
|