fulldump

package
v0.0.0-...-d6dd603 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package fulldump provides helper functions for full dump.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FullDump

func FullDump(
	ctx context.Context,
	cfg *Config,
	handler Handler,
) (gtidSet string, err error)

FullDump is similar to mysqldump --single-transaction, see mycanal's doc for prerequisites.

NOTE: Since `BeginTx` can not run 'START TRANSACTION WITH CONSISTENT SNAPSHOT', use `*sql.Conn` instead of `*sql.Tx`. More discussions:

Other refs:

Types

type Handler

type Handler func(ctx context.Context, q sqlh.Queryer) error

Handler is used to dump content.

type RowIter

type RowIter func(next bool) (map[string]interface{}, error)

RowIter is used for result set iteration. It returns nil if no more row. Caller should invoke RowIter(false) to close the iterator and release resource.

func FullTableQuery

func FullTableQuery(ctx context.Context, q sqlh.Queryer, dbName, table string) (RowIter, error)

FullTableQuery full dump a table.

func Query

func Query(ctx context.Context, q sqlh.Queryer, query string, args ...interface{}) (iter RowIter, err error)

Query and returns RowIter

Jump to

Keyboard shortcuts

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