dumper

package
v0.263.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const VITESS_GHOST_TABLE_REGEX = "_vt_([a-zA-Z0-9]{3})_([0-f]{32})_([0-9]{14})_"

https://github.com/vitessio/vitess/blob/7dd3c6b550eecc1b6a3beb685763f2cb7b6e2c17/go/vt/schema/name.go#L33

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	User                      string
	Password                  string
	Address                   string
	ToUser                    string
	ToPassword                string
	ToAddress                 string
	ToDatabase                string
	ToEngine                  string
	Database                  string
	DatabaseRegexp            string
	DatabaseInvertRegexp      bool
	Shard                     string
	Table                     string
	Outdir                    string
	OutputFormat              string
	SessionVars               []string
	Threads                   int
	ChunksizeInMB             int
	StmtSize                  int
	Allbytes                  uint64
	Allrows                   uint64
	OverwriteTables           bool
	SchemaOnly                bool
	DataOnly                  bool
	ShowDetails               bool
	StartingTable             string
	EndingTable               string
	AllowDifferentDestination bool
	MaxQuerySize              int
	Wheres                    map[string]string
	Selects                   map[string]map[string]string
	Filters                   map[string]map[string]string

	// Interval in millisecond.
	IntervalMs int
	Debug      bool
	Printer    *printer.Printer
}

Config describes the settings to dump from a database.

func NewDefaultConfig

func NewDefaultConfig() *Config

type Connection

type Connection struct {
	ID int
	// contains filtered or unexported fields
}

Connection tuple.

func (*Connection) Execute

func (conn *Connection) Execute(query string) error

Execute used to executes the query.

func (*Connection) Fetch

func (conn *Connection) Fetch(query string) (*sqltypes.Result, error)

Fetch used to fetch the results.

func (*Connection) StreamFetch

func (conn *Connection) StreamFetch(query string) (driver.Rows, error)

StreamFetch used to the results with streaming.

type Dumper

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

func NewDumper

func NewDumper(cfg *Config) (*Dumper, error)

func (*Dumper) Run

func (d *Dumper) Run(ctx context.Context) error

type Files added in v0.27.0

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

Files tuple.

type Loader added in v0.27.0

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

func NewLoader added in v0.27.0

func NewLoader(cfg *Config) (*Loader, error)

func (*Loader) Run added in v0.27.0

func (l *Loader) Run(ctx context.Context) error

Run used to start the loader worker.

type Pool

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

Pool tuple.

func NewPool

func NewPool(log *zap.Logger, cap int, address string, user string, password string, vars []string, database string) (*Pool, error)

NewPool creates the new pool.

func (*Pool) Close

func (p *Pool) Close()

Close used to close the pool and the connections.

func (*Pool) Get

func (p *Pool) Get() *Connection

Get used to get one connection from the pool.

func (*Pool) Put

func (p *Pool) Put(conn *Connection)

Put used to put one connection to the pool.

type TableWriter added in v0.259.0

type TableWriter interface {
	Initialize(fieldNames []string) error
	WriteRow(row []sqltypes.Value) (bytesAdded int, err error)
	ShouldFlush() bool
	Flush(outdir, database, table string, fileNo int) error
	Close(outdir, database, table string, fileNo int) error
}

Jump to

Keyboard shortcuts

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