File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -38,13 +38,13 @@ type Contract struct {
3838
3939// Database
4040type Database struct {
41- Path string `yaml:"path" validate:"required_if=Kind sqlite "`
42- Kind string `yaml:"kind" validate:"required,oneof=sqlite postgres mysql"`
43- Host string `yaml:"host" validate:"required_unless=Kind sqlite "`
44- Port int `yaml:"port" validate:"required_unless=Kind sqlite ,gt=-1,lt=65535"`
45- User string `yaml:"user" validate:"required_unless=Kind sqlite "`
46- Password string `yaml:"password" validate:"required_unless=Kind sqlite" `
47- Database string `yaml:"database" validate:"required_unless=Kind sqlite "`
41+ Path string `yaml:"path" validate:"required_without=Host Port User Database "`
42+ Kind string `yaml:"kind" validate:"required,oneof=sqlite postgres mysql clickhouse "`
43+ Host string `yaml:"host" validate:"required_with=Port User Database "`
44+ Port int `yaml:"port" validate:"required_with=Host User Database ,gt=-1,lt=65535"`
45+ User string `yaml:"user" validate:"required_with=Host Port Database "`
46+ Password string `yaml:"password"`
47+ Database string `yaml:"database" validate:"required_with=Host Port User "`
4848 SchemaName string `yaml:"schema_name"`
4949}
5050
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ package config
22
33// Supported database kinds
44const (
5- DBKindSqlite = "sqlite"
6- DBKindPostgres = "postgres"
7- DBKindMysql = "mysql"
5+ DBKindSqlite = "sqlite"
6+ DBKindPostgres = "postgres"
7+ DBKindMysql = "mysql"
8+ DBKindClickhouse = "clickhouse"
89)
You can’t perform that action at this time.
0 commit comments