@@ -36,18 +36,36 @@ func (c Config) HasActions() bool {
3636}
3737
3838// DatabaseConfig contains settings required to connect to the database.
39+ // You can specify either a complete DSN, or use structured fields, or a combination.
40+ // Structured fields override corresponding parts of the DSN when both are provided.
3941type DatabaseConfig struct {
40- // DSN is the Database Source Name connection string used to establish the database connection.
42+ // DSN is the Database Source Name connection string (optional if using structured fields).
43+ // Supports environment variable expansion via ${VAR_NAME} syntax.
44+ // Example: "postgres://${DB_HOST}:${DB_PORT}/${DB_DATABASE}?sslmode=disable"
4145 DSN string `yaml:"dsn" json:"dsn"`
4246
43- // These fields are not required if the DSN already includes the credentials.
44- // They should only be provided if the username or password contain characters that need URL encoding.
47+ // Structured connection fields (optional, override DSN components when set)
4548
46- // User is the database username used for authentication.
49+ // Scheme is the database type (e.g., "postgres", "mysql", "sqlserver", "oracle", "hdb")
50+ Scheme string `yaml:"scheme" json:"scheme"`
51+
52+ // Host is the database server hostname or IP address (may include port for some databases)
53+ Host string `yaml:"host" json:"host"`
54+
55+ // Port is the database server port number
56+ Port string `yaml:"port" json:"port"`
57+
58+ // Database is the name of the database to connect to
59+ Database string `yaml:"database" json:"database"`
60+
61+ // User is the database username used for authentication
4762 User string `yaml:"user" json:"user"`
4863
49- // Password is the database password used for authentication.
64+ // Password is the database password used for authentication
5065 Password string `yaml:"password" json:"password"`
66+
67+ // Params contains additional connection parameters (e.g., {"sslmode": "disable", "timeout": "30s"})
68+ Params map [string ]string `yaml:"params" json:"params"`
5169}
5270
5371// ResourceType defines configuration for a specific type of resource.
0 commit comments