dbsync

package
v0.27.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunShell

func RunShell(oldURL, newURL string) error

RunShell will start the switchover shell.

Types

type Column

type Column struct {
	Name string
	Type string
	Ord  int
}

func (Column) IsInteger

func (c Column) IsInteger() bool

type Sync

type Sync struct {
	// contains filtered or unexported fields
}

func NewSync

func NewSync(ctx context.Context, oldDB, newDB *sql.DB, newURL string) (*Sync, error)

func (*Sync) Aborted

func (s *Sync) Aborted() bool

func (*Sync) ChangeLogDisable added in v0.23.0

func (s *Sync) ChangeLogDisable(ctx context.Context, sh *ishell.Context) error

ChangeLogDisable will remove all sync instrumentation.

func (*Sync) ChangeLogEnable added in v0.23.0

func (s *Sync) ChangeLogEnable(ctx context.Context, sh *ishell.Context) error

ChangeLogEnable will instrument the database for the sync operation.

func (*Sync) NodeStateWait

func (s *Sync) NodeStateWait(ctx context.Context, origTotal int, bar *mpb.Bar, anyState ...switchover.State) error

func (*Sync) NodeStatus

func (s *Sync) NodeStatus() []switchover.Status

func (*Sync) Offset

func (s *Sync) Offset() time.Duration

func (*Sync) Ready

func (s *Sync) Ready() bool

func (*Sync) RefreshTables added in v0.23.0

func (s *Sync) RefreshTables(ctx context.Context) error

func (*Sync) Sync

func (s *Sync) Sync(ctx context.Context, isFinal, enableSwitchOver bool) error

type Table

type Table struct {
	Name    string
	Columns []Column
	IDCol   Column

	DependsOn   map[string]bool
	DependantOf map[string]bool
}

func Tables

func Tables(ctx context.Context, db *sql.DB) ([]Table, error)

func (Table) ColumnNames

func (t Table) ColumnNames() []string

func (Table) DeleteOneRow

func (t Table) DeleteOneRow() string

func (Table) FetchOneRow

func (t Table) FetchOneRow() string

func (Table) InsertOneRow

func (t Table) InsertOneRow() string

func (Table) SafeName

func (t Table) SafeName() string

func (Table) UpdateOneRow

func (t Table) UpdateOneRow() string

type WaitState

type WaitState struct {
	Done  int
	Total int
	Abort bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL