Documentation ¶
Index ¶
- func ApplyMigrationTx(ctx context.Context, env Env, state State) error
- func ApplyMigrations(ctx context.Context, db *pachsql.DB, baseEnv Env, state State) (retErr error)
- func BlockUntil(ctx context.Context, db *pachsql.DB, state State) error
- func Squash(s *State)
- type ApplyOpt
- type Env
- type Func
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyMigrationTx ¶ added in v2.6.1
func ApplyMigrations ¶
ApplyMigrations does the necessary work to actualize state. It will manipulate the objects available in baseEnv, and use the migrations table in db.
func BlockUntil ¶
BlockUntil blocks until state is actualized. It makes no attempt to perform migrations, hopefully another process is working on that by calling ApplyMigrations. If the cluster ever enters a state newer than the state passed to BlockUntil, it errors.
Types ¶
type Env ¶
type Env struct { // TODO: etcd ObjectClient obj.Client Tx *pachsql.Tx EtcdClient *clientv3.Client WithTableLocks bool }
Env contains all the objects that can be manipulated during a migration. The Tx field will be overwritten with the transaction that the migration should be performed in.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State represents a state of the cluster, including all the steps taken to get there.
func CollectStates ¶ added in v2.6.1
CollectStates does a reverse order traversal of a linked list and adds each item to a slice
func InitialState ¶
func InitialState() State
InitialState returns a cluster that has no migrations. The initial state contains a change which is just to create the migration table.