common

package
v5.3.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: Apache-2.0 Imports: 9 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDB

func CreateDB(ctx context.Context, dbConfig *dbutil.DBConfig, vars map[string]string, num int) (db *sql.DB, err error)

CreateDB creates sql.DB used for select data

func CreateDBForCP

func CreateDBForCP(ctx context.Context, dbConfig dbutil.DBConfig) (cpDB *sql.DB, err error)

CreateDBForCP creates sql.DB used for write data for checkpoint

Types

type RowData

type RowData struct {
	Data   map[string]*dbutil.ColumnData
	Source int
}

type RowDatas

type RowDatas struct {
	Rows         []RowData
	OrderKeyCols []*model.ColumnInfo
}

RowDatas is a heap of MergeItems.

func (RowDatas) Len

func (r RowDatas) Len() int

func (RowDatas) Less

func (r RowDatas) Less(i, j int) bool

func (*RowDatas) Pop

func (r *RowDatas) Pop() (x interface{})

Pop implements heap.Interface's Pop function

func (*RowDatas) Push

func (r *RowDatas) Push(x interface{})

Push implements heap.Interface's Push function

func (RowDatas) Swap

func (r RowDatas) Swap(i, j int)

type TableDiff

type TableDiff struct {
	// Schema represents the database name.
	Schema string `json:"schema"`

	// Table represents the table name.
	Table string `json:"table"`

	// Info is the parser.TableInfo, include some meta infos for this table.
	// It used for TiDB/MySQL/MySQL Shard sources.
	Info *model.TableInfo `json:"info"`

	// columns be ignored
	IgnoreColumns []string `json:"-"`

	// field should be the primary key, unique key or field with index
	Fields string `json:"fields"`

	// select range, for example: "age > 10 AND age < 20"
	Range string `json:"range"`

	// ignore check table's data
	IgnoreDataCheck bool `json:"-"`

	// the table has column timestamp, which need to reset time_zone.
	NeedUnifiedTimeZone bool `json:"-"`

	Collation string `json:"collation"`

	ChunkSize int64 `json:"chunk-size"`
}

TableDiff saves config for diff table

type TableShardSource

type TableShardSource struct {
	TableSource
	// DBConn represents the origin DB connection for this TableSource.
	// This TableSource may exists in different MySQL shard.
	DBConn *sql.DB
}

TableShardSource represents the origin schema and table and DB connection before router. It used for MySQL Shard source.

type TableSource

type TableSource struct {
	OriginSchema string
	OriginTable  string
}

TableSource represents the origin schema and table before router. It used for TiDB/MySQL source.

Jump to

Keyboard shortcuts

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