feat: add source and target database type fields

Add source_db_type and target_db_type to the migration config so the same binary can drive any supported direction.
This commit is contained in:
2026-04-17 13:00:00 -05:00
parent ecf0937a53
commit f0caa55a21
21 changed files with 511 additions and 191 deletions

View File

@@ -0,0 +1,19 @@
package dbwrapper
import "fmt"
type Factory func() DbWrapper
var drivers = make(map[string]Factory)
func Register(name string, factory Factory) {
drivers[name] = factory
}
func New(driverType string) (DbWrapper, error) {
factory, ok := drivers[driverType]
if !ok {
return nil, fmt.Errorf("driver not yet supported: %s", driverType)
}
return factory(), nil
}