Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultSource = "default_source"
)
Variables ¶
View Source
var DBSourceNotFoundError = errors.New("database source not found")
Functions ¶
func AddDBSource ¶
AddDBSource adds a new source to the sources map If the source already exists, it will be overwritten
func GetDBSource ¶
GetDBSource returns a source from the sources map If the source does not exist, it will return an error
func InitializeMigrator ¶
func InitializeMigrator(driver database.Driver, conf MigratorConfig) error
InitializeMigrator initializes the migrator
func InitializeSources ¶
InitializeSources initializes the sources map If the map is nil, it will create a new one
Types ¶
type MigratorConfig ¶
type MigratorConfig struct { MigrationsFolder string `inject:"property:db.migrator.folder;default:resources/migrations"` DriverName string `inject:"property:db.driver;default:postgres"` Enabled bool `inject:"property:db.migrator.enabled;default:true"` }
MigratorConfig is the configuration for the migrator It is used to inject the configuration from the config file The default values are used if the configuration is not found The default values are:
MigrationsFolder: resources/migrations (relative to the project root)
DriverName: postgres
Enabled: true
Click to show internal directories.
Click to hide internal directories.