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 SendDeadSignal(db *sql.DB, pipeline string) error
- func SetMySQLGlobalVars(db *sql.DB)
- func SourceDBConfig() *utils.DBConfig
- 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 DummyTableName = "dummy_table"
View Source
const TestDBPrefix = "__test_drc__"
View Source
const TestScanColumnTableIdPrimary = "test_scan_column_id_primary"
View Source
const TestScanColumnTableMultiPrimary = "test_scan_column_multiple_primary"
View Source
const TestScanColumnTableNoKey = "test_scan_column_no_key"
View Source
const TestScanColumnTableUniqueIndexEmailString = "test_scan_column_unique_index_email_string"
View Source
const TestScanColumnTableUniqueIndexTime = "test_scan_column_unique_index_time"
View Source
const TestTableName = "test_table"
View Source
const TestTableWithoutTs = "test_table_without_ts"
View Source
const TxnRouteTableName = "drc_routes"
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 SetMySQLGlobalVars ¶
func SourceDBConfig ¶
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.