sync

package
v0.0.0-...-d608ac7 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump

func Dump() ([]byte, error)

func Restore

func Restore()

func Sync

func Sync(ctx context.Context, deferConstraints bool, tasks []Task, source *datasource.ReaderDataSource, dest *datasource.ReadWriteDatasource) error

Types

type SafeBuffer

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

func NewSafeBuffer

func NewSafeBuffer(buffer io.ReadWriter) *SafeBuffer

func (*SafeBuffer) Read

func (b *SafeBuffer) Read(p []byte) (n int, err error)

func (*SafeBuffer) SetDone

func (b *SafeBuffer) SetDone()

func (*SafeBuffer) Write

func (b *SafeBuffer) Write(p []byte) (n int, err error)

type TableSync

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

func (*TableSync) Sync

func (t *TableSync) Sync(ctx context.Context, task *Task) error

type Task

type Task struct {
	db.Table
	DestColumns      []db.Column
	SourceColumns    []db.Column
	DestPK           []db.PrimaryKey
	SourceSequences  []db.Sequence
	DestSequences    []db.Sequence
	Filter           string
	Preserve         bool
	Truncate         bool
	DeferConstraints bool
}

func (*Task) GetDestPKs

func (t *Task) GetDestPKs() []string

func (*Task) GetSharedColumnNames

func (t *Task) GetSharedColumnNames() []string

type TaskResolver

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

func NewTaskResolver

func NewTaskResolver(source *datasource.ReaderDataSource, destination *datasource.ReadWriteDatasource, groups map[string]map[string]string, truncate bool, preserve bool, deferConstraints bool, excluded []db.Table) *TaskResolver

func (*TaskResolver) Resolve

func (tr *TaskResolver) Resolve(ctx context.Context, groupArgs []string, tableArgs []string) ([]Task, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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