Documentation ¶
Index ¶
- func EnsureTableExists(session *gocql.Session) error
- type IMaintainVersions
- type IManageVersions
- type IRecallVersions
- type VersionService
- func (vs *VersionService) AddVersion(version int, description string, appliedOn time.Time) error
- func (vs *VersionService) ApplyChanges(stmts []string) (err error)
- func (vs *VersionService) GetCurrentVersion() (int, error)
- func (vs *VersionService) GetPreviousVersion() (int, int, error)
- func (vs *VersionService) RemoveVersion(version int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureTableExists ¶
EnsureTableExists makes sure the schema version table is present
Types ¶
type IMaintainVersions ¶
type IMaintainVersions interface { ApplyChanges(stmts []string) error AddVersion(version int, description string, appliedOn time.Time) error RemoveVersion(version int) error }
IMaintainVersions performs update to the schema and its info table
type IManageVersions ¶
type IManageVersions interface { GetPreviousVersion() (int, int, error) GetCurrentVersion() (int, error) ApplyChanges(stmts []string) error AddVersion(version int, description string, appliedOn time.Time) error RemoveVersion(version int) error }
IManageVersions manages interactions with the Schema Info table
type IRecallVersions ¶
type IRecallVersions interface { GetPreviousVersion() (int, int, error) GetCurrentVersion() (int, error) }
IRecallVersions can retrieve current and previous version from the info table
type VersionService ¶
VersionService is a concrete implementation of IManageVersions
func (*VersionService) AddVersion ¶
AddVersion inserts a new updated version of the schema to the info table
func (*VersionService) ApplyChanges ¶
func (vs *VersionService) ApplyChanges(stmts []string) (err error)
ApplyChanges execute cql script
func (*VersionService) GetCurrentVersion ¶
func (vs *VersionService) GetCurrentVersion() (int, error)
GetCurrentVersion returns the current version of the database schema
func (*VersionService) GetPreviousVersion ¶
func (vs *VersionService) GetPreviousVersion() (int, int, error)
GetPreviousVersion returns the previous version of the database schema
func (*VersionService) RemoveVersion ¶
func (vs *VersionService) RemoveVersion(version int) error
RemoveVersion inserts a new updated version of the schema to the info table