Skip to content

Commit

Permalink
Use clickhouse DSN when dialect is clickhouse-replicated
Browse files Browse the repository at this point in the history
  • Loading branch information
chapsuk committed Jan 30, 2023
1 parent be4e630 commit 3739f0c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ func fillDBConfig(cfg *driver.Config) {
// Allow single config for many databases
if viper.IsSet("dialect") {
cfg.Dialect = viper.GetString("dialect")
cfg.Dsn = viper.GetString(cfg.Dialect + ".dsn")
if cfg.Dialect == "clickhouse-replicated" {
cfg.Dsn = viper.GetString("clickhouse.dsn")
} else {
cfg.Dsn = viper.GetString(cfg.Dialect + ".dsn")
}
return
}

Expand Down

0 comments on commit 3739f0c

Please sign in to comment.