Documentation ¶
Index ¶
- Constants
- type ErrApplyFile
- type ErrApplyFileRead
- type ErrApplyFileTemplate
- type ErrCreateTable
- type ErrTrackingInfo
- type ErrUnknownVersion
- type FSOpener
- type Logger
- type Manager
- func (mng *Manager) DBVersion(db *sql.DB) (string, error)
- func (mng *Manager) FS() FSOpener
- func (mng *Manager) FuncMap() template.FuncMap
- func (mng *Manager) HasTrackingTable(db *sql.DB) bool
- func (mng *Manager) Init(db *sql.DB, author string) (ver string, didInit bool, err error)
- func (mng *Manager) LatestVersion() (string, error)
- func (mng *Manager) Log() Logger
- func (mng *Manager) SetLog(l Logger)
- func (mng *Manager) TableName() string
- func (mng *Manager) Upgrade(db *sql.DB, author string) (startingVersion string, newVersion string, err error)
- func (mng *Manager) VersionFile() string
- func (mng *Manager) Versions() ([]string, error)
Constants ¶
View Source
const (
// InitialVersion represents the value of the very first version, an empty database.
InitialVersion = ""
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrApplyFile ¶
func (ErrApplyFile) Error ¶
func (err ErrApplyFile) Error() string
func (ErrApplyFile) Unwrap ¶
func (err ErrApplyFile) Unwrap() error
type ErrApplyFileRead ¶
func (ErrApplyFileRead) Error ¶
func (err ErrApplyFileRead) Error() string
func (ErrApplyFileRead) Unwrap ¶
func (err ErrApplyFileRead) Unwrap() error
type ErrApplyFileTemplate ¶
func (ErrApplyFileTemplate) Error ¶
func (err ErrApplyFileTemplate) Error() string
func (ErrApplyFileTemplate) Unwrap ¶
func (err ErrApplyFileTemplate) Unwrap() error
type ErrCreateTable ¶
func (ErrCreateTable) Error ¶
func (err ErrCreateTable) Error() string
func (ErrCreateTable) Unwrap ¶
func (err ErrCreateTable) Unwrap() error
type ErrTrackingInfo ¶
func (ErrTrackingInfo) Error ¶
func (err ErrTrackingInfo) Error() string
func (ErrTrackingInfo) Unwrap ¶
func (err ErrTrackingInfo) Unwrap() error
type ErrUnknownVersion ¶
type ErrUnknownVersion string
func (ErrUnknownVersion) Error ¶
func (err ErrUnknownVersion) Error() string
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager will manage a set of migration file and apply them to the database
func (*Manager) Init ¶
Init will ensure that the initial tables for the file correctly initialized, it returns the current database version
func (*Manager) LatestVersion ¶
func (*Manager) Upgrade ¶
func (mng *Manager) Upgrade(db *sql.DB, author string) (startingVersion string, newVersion string, err error)
Upgrade will upgrade the db file to the latest schema
func (*Manager) VersionFile ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package schema provide a general interface to obtain schema information from a database
|
Package schema provide a general interface to obtain schema information from a database |
sqlite
Package sqlite provides the schema interface for an SQLite database.
|
Package sqlite provides the schema interface for an SQLite database. |
Click to show internal directories.
Click to hide internal directories.