dumper

package
v0.137.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

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
	Table                string
	Outdir               string
	SessionVars          string
	Threads              int
	ChunksizeInMB        int
	StmtSize             int
	Allbytes             uint64
	Allrows              uint64
	OverwriteTables      bool
	Wheres               map[string]string
	Selects              map[string]map[string]string
	Filters              map[string]map[string]string

	// Interval in millisecond.
	IntervalMs int
	Debug      bool
}

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.

Jump to

Keyboard shortcuts

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