Deprecate QueryM2MWithCtx and QueryTableWithCtx

- Add methods with `WithCtx` suffix and remove ctx fileld from QueryStter
and QueryM2M.
- Deprecate QueryTableWithCtx and QueryM2MWithCtx.

Signed-off-by: Penghui Liao <liaoishere@gmail.com>
This commit is contained in:
Penghui Liao
2021-01-10 13:59:01 +08:00
parent 21777d3143
commit ef227bf467
13 changed files with 130 additions and 68 deletions

View File

@@ -2836,7 +2836,7 @@ func TestContextCanceled(t *testing.T) {
ctx, cancel = context.WithCancel(context.Background())
cancel()
qs := dORM.QueryTable(user).WithContext(ctx)
_, err = qs.Filter("UserName", "slene").Count()
qs := dORM.QueryTable(user)
_, err = qs.Filter("UserName", "slene").CountWithCtx(ctx)
throwFail(t, AssertIs(err, context.Canceled))
}