Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DialectExecutor ¶
type DialectExecutor interface {
// Setup is called on the dialect on initialization, returns the DSN (modified if necessary) to use for migrations
Setup(context.Context) (string, error)
// Identifier returns a unique identifier for the database if possible, or "", false
Identifier(context.Context) (string, bool)
// Validate is called before startup to check that the dialect can execute properly. If returns true and error is set, the error is merely logged.
Validate(context.Context) (bool, error)
// Prepare is called before migrations and upgrades are run
Prepare(context.Context) error
// Finalize is called after migrations and upgrades are run, with the resulting error. This function can modify the returning error from the migrator.
Finalize(context.Context, error) error
}
func GetExecutor ¶
func GetExecutor(dsn string, c *history.Config) (schema.DialectType, DialectExecutor, error)
type SimpleStorage ¶
type SimpleStorage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func NewStorage(dsn string, dialect DialectExecutor) *SimpleStorage
func (SimpleStorage) DSN ¶
func (s SimpleStorage) DSN() string
func (SimpleStorage) DialectExecutor ¶
func (s SimpleStorage) DialectExecutor() DialectExecutor
type Storage ¶
type Storage interface {
DSN() string
DialectExecutor() DialectExecutor
}
Click to show internal directories.
Click to hide internal directories.