Documentation ¶
Index ¶
- Constants
- Variables
- func CountTestTable(db *sql.DB, testDBName string, testTableName string) (int, error)
- func DeleteTestTable(db *sql.DB, testDBName string, testTableName string, id int) error
- func InsertIntoTestTable(db *sql.DB, testDBName string, testTableName string, ...) error
- func InsertIntoTestTableWithTxnRoute(db *sql.DB, testDBName string, testTableName string, ...) error
- func IsDeadSignal(schema string, table string) bool
- func IsTestDB(schemaName string) bool
- func MustCreateSourceDBConn() *sql.DB
- func MustCreateTargetDBConn() *sql.DB
- func MustSetupSourceDB(dbName string) *sql.DB
- func MustSetupTargetDB(dbName string) *sql.DB
- func QueryTestTable(db *sql.DB, testDBName string, testTableName string, id int) (string, error)
- func SeedCompositePrimaryKeyInt(db *sql.DB, dbName string)
- func SendDeadSignal(db *sql.DB, pipeline string) error
- func SetMySQLGlobalVars(db *sql.DB)
- func SourceDBConfig() *utils.DBConfig
- func TableChecksum(db *sql.DB, dbName string, tableName string) string
- func TargetDBConfig() *utils.DBConfig
- func TestChecksum(t *testing.T, tableNames []string, sourceDB *sql.DB, sourceDBName string, ...)
- func TestDBName(name string) string
- func UpdateTestTable(db *sql.DB, testDBName string, testTableName string, id int, newName string) error
- func UpdateTestTableWithMultiRows(db *sql.DB, testDBName string, testTableName string, whereClause string) error
- type Column
- type Generator
- type GeneratorConfig
- type MysqlTableDataGenerator
Constants ¶
View Source
const ( TestTableName = "test_table" TestTableWithoutTs = "test_table_without_ts" DummyTableName = "dummy_table" TxnRouteTableName = "drc_routes" TestScanColumnTableIdPrimary = "test_scan_column_id_primary" TestScanColumnTableCompositePrimary = "test_scan_column_multiple_primary" TestScanColumnTableCompositePrimaryInt = "test_scan_column_composite_pk_int" TestScanColumnTableCompositePrimaryOutOfOrder = "test_scan_column_multiple_pk_unordered" TestScanColumnTableUniqueIndexEmailString = "test_scan_column_unique_index_email_string" TestScanColumnTableUniqueIndexTime = "test_scan_column_unique_index_time" TestScanColumnTableCompositeUniqueKey = "test_scan_column_multi_uk" TestScanColumnTableNoKey = "test_scan_column_no_key" )
View Source
const TestDBPrefix = "__test_drc__"
Variables ¶
View Source
var MaxConn = 2048
Functions ¶
func CountTestTable ¶
func DeleteTestTable ¶
func InsertIntoTestTable ¶
func IsDeadSignal ¶
func MustCreateSourceDBConn ¶
func MustCreateTargetDBConn ¶
func MustSetupSourceDB ¶
MustSetupSourceDB setup a test db, so that we can use different db in different test cases
func MustSetupTargetDB ¶
func QueryTestTable ¶
func SeedCompositePrimaryKeyInt ¶ added in v0.9.27
func SetMySQLGlobalVars ¶
func SourceDBConfig ¶
func TableChecksum ¶ added in v0.9.27
func TargetDBConfig ¶
func TestChecksum ¶
func TestDBName ¶
func UpdateTestTable ¶
Types ¶
type Generator ¶
type Generator struct { GeneratorConfig SourceDB *sql.DB SourceSchema string TargetDB *sql.DB TargetSchema string // contains filtered or unexported fields }
func (*Generator) ParallelUpdate ¶
func (*Generator) SetupTestTables ¶
func (*Generator) TestChecksum ¶
type GeneratorConfig ¶
type GeneratorConfig struct { NrTables int `json:"nrTables" yaml:"nrTables"` NrSeedRows int `json:"nrSeedRows" yaml:"nrSeedRows"` DeleteRatio float32 `json:"deleteRatio" yaml:"deleteRatio"` InsertRatio float32 `json:"insertRatio" yaml:"insertRatio"` Concurrency int `json:"concurrency" yaml:"concurrency"` TransactionLength int `json:"transactionLength" yaml:"transactionLength"` }
type MysqlTableDataGenerator ¶
func NewMysqlTableDataGenerator ¶
func NewMysqlTableDataGenerator(db *sql.DB, schema string, table string) MysqlTableDataGenerator
func (*MysqlTableDataGenerator) InitData ¶
func (g *MysqlTableDataGenerator) InitData(num int, r *rand.Rand) (stmt string, args []interface{})
func (*MysqlTableDataGenerator) RandomStmt ¶
Click to show internal directories.
Click to hide internal directories.