feat: add include and exclude filtering options for database discovery
Build and Push / build (godump, amd64, linux) (push) Successful in 18s

This commit is contained in:
2026-06-04 18:45:41 +00:00
parent 13009580f3
commit 9a417155fc
3 changed files with 44 additions and 8 deletions
+27
View File
@@ -39,6 +39,33 @@ func discoverDatabases(cfg config.InstanceConfig) ([]string, error) {
if err := rows.Scan(&name); err != nil {
return nil, err
}
if len(cfg.Include) > 0 {
included := false
for _, inc := range cfg.Include {
if name == inc {
included = true
break
}
}
if !included {
continue
}
}
if len(cfg.Exclude) > 0 {
excluded := false
for _, exc := range cfg.Exclude {
if name == exc {
excluded = true
break
}
}
if excluded {
continue
}
}
databases = append(databases, name)
}