MustQueryWithContext query the statements and returns result rows.
(ctx context.Context, sql string, args ...any)
| 241 | |
| 242 | // MustQueryWithContext query the statements and returns result rows. |
| 243 | func (tk *TestKit) MustQueryWithContext(ctx context.Context, sql string, args ...any) *Result { |
| 244 | comment := fmt.Sprintf("sql:%s, args:%v", sql, args) |
| 245 | rs, err := tk.ExecWithContext(ctx, sql, args...) |
| 246 | tk.require.NoError(err, comment) |
| 247 | tk.require.NotNil(rs, comment) |
| 248 | return tk.ResultSetToResultWithCtx(ctx, rs, comment) |
| 249 | } |
| 250 | |
| 251 | // EventuallyMustIndexLookup checks whether the plan for the sql is IndexLookUp. |
| 252 | func (tk *TestKit) EventuallyMustIndexLookup(sql string, args ...any) *Result { |