Documentation ¶
Index ¶
- func CharsetWhite() []string
- func IsCannotAddOrUpdateAChildRowError(err error) bool
- func MaxSampling() uint64
- func ParseCreateTableStmt(create string) (*ast.CreateTableStmt, error)
- func Sampling() bool
- func TrimBlockFormat(create string) string
- func TrimCharacterSetFromRawCreateTableSQL(create string, except ...string) string
- func TrimCollateOptionFromCols(create *ast.CreateTableStmt)
- func TrimCollateOptionFromCreateTable(create *ast.CreateTableStmt)
- func TrimConstraintCheckFromCreateTable(create *ast.CreateTableStmt)
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CharsetWhite ¶ added in v1.5.0
func CharsetWhite() []string
func IsCannotAddOrUpdateAChildRowError ¶ added in v1.5.0
func MaxSampling ¶ added in v1.5.0
func MaxSampling() uint64
MaxSampling returns the max sampling size. Set it by env "PIPELINE_MIGRATION_SAMPLING_SIZE"
func ParseCreateTableStmt ¶ added in v1.3.0
func ParseCreateTableStmt(create string) (*ast.CreateTableStmt, error)
ParseCreateTableStmt parses CreateTableStmt as *ast.CreateTableStmt node
func Sampling ¶ added in v1.5.0
func Sampling() bool
Sampling returns true if it needs to sampling when snapshot. Set it by env "PIPELINE_MIGRATION_DATABASE=true"
func TrimBlockFormat ¶ added in v1.5.0
func TrimCollateOptionFromCols ¶
func TrimCollateOptionFromCols(create *ast.CreateTableStmt)
func TrimCollateOptionFromCreateTable ¶
func TrimCollateOptionFromCreateTable(create *ast.CreateTableStmt)
func TrimConstraintCheckFromCreateTable ¶
func TrimConstraintCheckFromCreateTable(create *ast.CreateTableStmt)
Types ¶
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot maintains the structure of the database tables
func From ¶
From snapshots the structure of the database tables, and returns the Snapshot. tx is the connection handler of the goal DB. ignore is the tables you do not want to snapshot.
func (*Snapshot) Dump ¶ added in v1.5.0
Dump dumps data from DB. tableName is the table you want to dump. lines is the numbers of lines you want to dump. Note: lines is an approximate number rather than an exact number. Note: the max data size is not more than 1<<16 (the MySQL default max placeholders size).
func (*Snapshot) HasAnyTable ¶
HasAnyTable returns true if there is any table in the Snapshot
func (*Snapshot) TableNames ¶
TableNames returns all tables names