dbtool

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(a, b *DataInstance, showDiff bool) bool

func CompareDataSet

func CompareDataSet(base, current []*DataInstance, showSummary bool) bool

func DumpSelectInfo

func DumpSelectInfo(selectResult map[int64]int) bool

Types

type DBTestTool

type DBTestTool interface {
	Insert() ([]*DataInstance, error)
	Clean() error
	SetUp() error
	Update() ([]*DataInstance, error)
	Delete() ([]*DataInstance, error)
	Select([]*DataInstance) (map[int64]int, error)
}

func NewDBTestToolOnCK

func NewDBTestToolOnCK(conn sqlx.SqlConn) DBTestTool

func NewDBTestToolOnCKQuery

func NewDBTestToolOnCKQuery(conn sqlx.SqlConn) DBTestTool

func NewDBTestToolOnMongo

func NewDBTestToolOnMongo(dataSource, collection string) DBTestTool

func NewDBTestToolOnMySQL

func NewDBTestToolOnMySQL(dataSource string) DBTestTool

type DBTestToolMongo

type DBTestToolMongo struct {
	Database   string
	Collection string
	// contains filtered or unexported fields
}

func (*DBTestToolMongo) Clean

func (s *DBTestToolMongo) Clean() error

func (*DBTestToolMongo) Delete

func (s *DBTestToolMongo) Delete() ([]*DataInstance, error)

func (*DBTestToolMongo) Insert

func (s *DBTestToolMongo) Insert() ([]*DataInstance, error)

func (*DBTestToolMongo) Select

func (s *DBTestToolMongo) Select(dataSet []*DataInstance) (map[int64]int, error)

func (*DBTestToolMongo) SetUp

func (s *DBTestToolMongo) SetUp() error

func (*DBTestToolMongo) Update

func (s *DBTestToolMongo) Update() ([]*DataInstance, error)

type DBTestToolSqlConn

type DBTestToolSqlConn struct {
	// contains filtered or unexported fields
}

func (*DBTestToolSqlConn) Clean

func (s *DBTestToolSqlConn) Clean() error

func (*DBTestToolSqlConn) Delete

func (s *DBTestToolSqlConn) Delete() ([]*DataInstance, error)

func (*DBTestToolSqlConn) Insert

func (s *DBTestToolSqlConn) Insert() ([]*DataInstance, error)

func (*DBTestToolSqlConn) InsertBenchmarkCK

func (s *DBTestToolSqlConn) InsertBenchmarkCK() error

func (*DBTestToolSqlConn) InsertBenchmarkMySQL

func (s *DBTestToolSqlConn) InsertBenchmarkMySQL() error

func (*DBTestToolSqlConn) Select

func (s *DBTestToolSqlConn) Select(dataSet []*DataInstance) (map[int64]int, error)

func (*DBTestToolSqlConn) SetUp

func (s *DBTestToolSqlConn) SetUp() error

func (*DBTestToolSqlConn) Update

func (s *DBTestToolSqlConn) Update() ([]*DataInstance, error)

func (*DBTestToolSqlConn) UpdateBenchmark

func (s *DBTestToolSqlConn) UpdateBenchmark() ([]*DataInstance, error)

type DataInstance

type DataInstance struct {
	PK           int64     `db:"pk" bson:"pk"`
	IntValue     int       `db:"int_value" bson:"int_value"`
	FloatValue   float32   `db:"float_value" bson:"float_value"`
	DoubleValue  float64   `db:"double_value" bson:"double_value"`
	CharValue    string    `db:"char_value" bson:"char_value"`
	VarCharValue string    `db:"varchar_value" bson:"varchar_value"`
	TimeValue    time.Time `db:"time_value" bson:"time_value"`
}

func GenerateDataSet

func GenerateDataSet(num int) []*DataInstance

func UpdateDataSet

func UpdateDataSet(dataSet []*DataInstance) []*DataInstance

Jump to

Keyboard shortcuts

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