Documentation ¶
Index ¶
- func New() generator.Generator
- type DataGenerator
- type SQLSmith
- func (s *SQLSmith) AlterTableStmt(opt *generator.DDLOptions) (string, error)
- func (s *SQLSmith) BatchData(total, batchSize int) ([]string, error)
- func (s *SQLSmith) BeginWithOnlineTables(opt *generator.DMLOptions) []string
- func (s *SQLSmith) CreateIndexStmt(opt *generator.DDLOptions) (string, error)
- func (s *SQLSmith) CreateTableStmt() (string, string, error)
- func (s *SQLSmith) Debug()
- func (s *SQLSmith) DeleteStmt() (string, string, error)
- func (s *SQLSmith) EndTransaction() []string
- func (s *SQLSmith) GenData(total, batch int) (*DataGenerator, error)
- func (s *SQLSmith) GetCurrDBName() string
- func (s *SQLSmith) GetDB(db string) *types.Database
- func (s *SQLSmith) Hint() bool
- func (s *SQLSmith) InsertStmt(fn bool) (string, string, error)
- func (s *SQLSmith) InsertStmtStr(fn bool) (string, string, error)
- func (s *SQLSmith) LoadSchema(records [][5]string, indexes map[string][]string)
- func (s *SQLSmith) SelectForUpdateStmt(depth int) (string, string, error)
- func (s *SQLSmith) SelectStmt(depth int) (string, string, error)
- func (s *SQLSmith) SetDB(db string)
- func (s *SQLSmith) SetHint(hint bool)
- func (s *SQLSmith) SetStable(stable bool)
- func (s *SQLSmith) Stable()
- func (s *SQLSmith) UpdateStmt() (string, string, error)
- func (s *SQLSmith) Walk(tree ast.Node) (string, string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataGenerator ¶
type DataGenerator struct {
// contains filtered or unexported fields
}
DataGenerator defines data generator
type SQLSmith ¶
type SQLSmith struct { Rand *rand.Rand Databases map[string]*types.Database Node ast.Node // contains filtered or unexported fields }
SQLSmith defines SQLSmith struct
func (*SQLSmith) AlterTableStmt ¶
func (s *SQLSmith) AlterTableStmt(opt *generator.DDLOptions) (string, error)
AlterTableStmt alter table
func (*SQLSmith) BatchData ¶
BatchData generate testing data by schema in given batch return SQLs with insert statement
func (*SQLSmith) BeginWithOnlineTables ¶
func (s *SQLSmith) BeginWithOnlineTables(opt *generator.DMLOptions) []string
BeginWithOnlineTables begins a transaction with some online tables
func (*SQLSmith) CreateIndexStmt ¶
func (s *SQLSmith) CreateIndexStmt(opt *generator.DDLOptions) (string, error)
CreateIndexStmt create index
func (*SQLSmith) CreateTableStmt ¶
CreateTableStmt create table
func (*SQLSmith) DeleteStmt ¶
DeleteStmt implement delete statement from AST
func (*SQLSmith) EndTransaction ¶
EndTransaction ends transaction and set every table offline
func (*SQLSmith) GenData ¶
func (s *SQLSmith) GenData(total, batch int) (*DataGenerator, error)
GenData returns data generator
func (*SQLSmith) GetCurrDBName ¶
GetCurrDBName returns current selected dbname
func (*SQLSmith) InsertStmt ¶
InsertStmt implement insert statement from AST
func (*SQLSmith) InsertStmtStr ¶
InsertStmtStr make random insert statement SQL
func (*SQLSmith) LoadSchema ¶
LoadSchema init schemas, tables and columns record[0] dbname record[1] table name record[2] table type record[3] column name record[4] column type
func (*SQLSmith) SelectForUpdateStmt ¶
SelectForUpdateStmt make random select statement SQL with for update lock
func (*SQLSmith) SelectStmt ¶
SelectStmt make random select statement SQL
func (*SQLSmith) UpdateStmt ¶
UpdateStmt make random update statement SQL