-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdrivers.go
More file actions
21 lines (17 loc) · 747 Bytes
/
Copy pathdrivers.go
File metadata and controls
21 lines (17 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package app
import (
"github.com/nixrajput/siphon/internal/driver"
_ "github.com/nixrajput/siphon/internal/driver/mariadb" // register the mariadb driver
_ "github.com/nixrajput/siphon/internal/driver/mysql" // register the mysql driver
_ "github.com/nixrajput/siphon/internal/driver/postgres" // register the postgres driver
)
// DefaultDrivers returns a DriverGetter backed by the global driver registry.
// Presentation layers (CLI, TUI) use this so they never import internal/driver
// directly — dependency flows through the application layer.
func DefaultDrivers() DriverGetter {
return registryGetter{}
}
type registryGetter struct{}
func (registryGetter) Get(name string) (driver.Driver, error) {
return driver.Get(name)
}