Documentation ¶
Index ¶
- func Rows(args ...string) [][]interface{}
- type Result
- type TestKit
- func (tk *TestKit) CheckExecResult(affectedRows, insertID int64)
- func (tk *TestKit) Exec(sql string, args ...interface{}) (ast.RecordSet, error)
- func (tk *TestKit) MustExec(sql string, args ...interface{})
- func (tk *TestKit) MustQuery(sql string, args ...interface{}) *Result
- func (tk *TestKit) ResultSetToResult(rs ast.RecordSet, comment check.CommentInterface) *Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result is the result returned by MustQuery.
func (*Result) Check ¶
func (res *Result) Check(expected [][]interface{})
Check asserts the result equals the expected results.
func (*Result) CheckAt ¶
CheckAt asserts the result of selected columns equals the expected results.
type TestKit ¶
TestKit is a utility to run sql test.
func NewTestKit ¶
NewTestKit returns a new *TestKit.
func NewTestKitWithInit ¶
NewTestKitWithInit returns a new *TestKit and creates a session.
func (*TestKit) CheckExecResult ¶
CheckExecResult checks the affected rows and the insert id after executing MustExec.
func (*TestKit) Exec ¶
Exec executes a sql statement.
func (*TestKit) MustExec ¶
MustExec executes a sql statement and asserts nil error.
func (*TestKit) MustQuery ¶
MustQuery query the statements and returns result rows. If expected result is set it asserts the query result equals expected result.
Click to show internal directories.
Click to hide internal directories.