Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Arg ¶
type Arg struct { // arg data type DataType DataType `yaml:"data_type"` // arg generation mode: // sequential: // random: GenType GenType `yaml:"gen_type"` // Prefix used to generate string arg // the argument will be prefixed with the given prefix // appended with query number Prefix string `yaml:"prefix"` // min value of generated argument Min int `yaml:"min"` // max value of generated random value Max int `yaml:"max"` }
Arg represents a database query arg
type DataType ¶
type DataType string
DataType is the data type of the query argument
const ( // DataTypeInteger is query argument with data type = integer. // It is equivalent to Go's `int` DataTypeInteger DataType = "integer" // DataTypeString is query argument with data type = string. // It is equivalent to Go's string DataTypeString DataType = "string" // DataTypeTime is query argument with data type = timestamp. // It is equivalent to Go's time.Time and will always // be converted to time.Now() DataTypeTime DataType = "time" )
type GenType ¶
type GenType string
GenType is the method used to generate the argument
const ( // GenTypeSequential define argument generator in sequential mode // integer: query number + Arg.Min // string : prefix + query number GenTypeSequential GenType = "sequential" // GenTypeRandom define argument generator in random mode // integer: between specified range (min-max) // string : prefix + integer between specified range GenTypeRandom GenType = "random" )
type Query ¶
type Query struct { // Name of the query, only used for informational purpose Name string `yaml:"name"` // Total number of queries which will be executed NumQuery int `yaml:"num_query"` // Query type Type TypeType `yaml:"type"` // Query string QueryStr string `yaml:"query_str"` // Query arguments Args []Arg `yaml:"args"` // True if we want to make it a prepared statement Prepare bool `yaml:"prepare"` // True if we want to prepare it once during the initialization. // Otherwise we prepare it before executing the query PrepareOnInit bool `yaml:"prepare_on_init"` // True if the query contains placeholder WithPlaceholder bool `yaml:"with_placeholder"` }
Query represents a database query
type TypeType ¶
type TypeType string
TypeType is the type for query type
const ( // TypeExec is type of query which will executes db.Exec command // https://golang.org/pkg/database/sql/#DB.Exec TypeExec TypeType = "exec" // TypeExecContext is type of query which will executes db.ExecContext command // https://golang.org/pkg/database/sql/#DB.ExecContext TypeExecContext TypeType = "exec_context" // TypeQuery is type of query which will executes db.Query command // https://golang.org/pkg/database/sql/#DB.Query TypeQuery TypeType = "query" // TypeQueryContext is type of query which will executes db.QueryContext command // https://golang.org/pkg/database/sql/#DB.QueryContext TypeQueryContext TypeType = "query_context" )
Click to show internal directories.
Click to hide internal directories.