MustExec query the statements and returns the result.
(sql string, args ...any)
| 66 | |
| 67 | // MustExec query the statements and returns the result. |
| 68 | func (tk *DBTestKit) MustExec(sql string, args ...any) sql.Result { |
| 69 | comment := fmt.Sprintf("sql:%s, args:%v", sql, args) |
| 70 | rs, err := tk.db.Exec(sql, args...) |
| 71 | tk.require.NoError(err, comment) |
| 72 | tk.require.NotNil(rs, comment) |
| 73 | return rs |
| 74 | } |
| 75 | |
| 76 | // MustQuery query the statements and returns result rows. |
| 77 | func (tk *DBTestKit) MustQuery(sql string, args ...any) *sql.Rows { |