Documentation ¶
Overview ¶
Package migrate provides simple and flexible CLQ migrations. Migrations can be read from a flat directory containing cql files. There is no imposed naming schema, migration name is file name and the migrations are processed in lexicographical order. Caller provides a gocql.Session, the session must use a desired keyspace as migrate would try to create migrations table.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CallbackEvent ¶
type CallbackEvent uint8
CallbackEvent specifies type of the event when calling CallbackFunc.
const ( BeforeMigration CallbackEvent = iota AfterMigration )
enumeration of CallbackEvents
type CallbackFunc ¶
type CallbackFunc func(ctx context.Context, session *gocql.Session, ev CallbackEvent, name string) error
CallbackFunc enables interrupting the migration process and executing code while migrating. If error is returned the migration is aborted.
var Callback CallbackFunc
Callback is called before and after each migration. See CallbackFunc for details.