Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FncVersion ¶
FncVersion is the function signature for doing a single version schema update. It takes a transaction object and should return an error on any type of failure. The service itself will take responsibility for commit or rollback.
type Repository ¶
type Repository interface { Version() (version int, err error) SetVersion(tx *sqlx.Tx, version int) (err error) DB() *sqlx.DB Service() string }
Repository holds a database specific implementation for the generic versioning service.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is our versioning Service.
func New ¶
New tries to create and return a new versioning service for provided database connection.
func (*Service) Add ¶
func (s *Service) Add(version int, fnc FncVersion)
Add allows one to add a version upgrade function with the version number to the versioning service.
Directories ¶
Path | Synopsis |
---|---|
Package postgresql provides the needed specifics to support the generic versioning service.
|
Package postgresql provides the needed specifics to support the generic versioning service. |
Package sqlite3 provides the needed specifics to support the generic versioning service.
|
Package sqlite3 provides the needed specifics to support the generic versioning service. |
Package sqlserver provides the needed specifics to support the generic versioning service.
|
Package sqlserver provides the needed specifics to support the generic versioning service. |
Click to show internal directories.
Click to hide internal directories.