```diff
// Filter is an interface to filter SQL
type Filter interface {
--- Do(sql string) string
+++ Do(ctx context.Context, sql string) string
}
```
### Adds a `Context` parameter to the `Do` method of the Filter interface.
Developers can rewrite SQL through the `Filter` `Do` method and **need to get the necessary data from the Context** to assist.
For example, get user information through `Context`, so that different users can use different tables. Another example is to get the flags through `Context` to add annotations to the SQL, and use the annotations to let the subsequent `DB-Proxy` to achieve read/write separation.
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2270
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: LinkinStars <linkinstar@foxmail.com>
Co-committed-by: LinkinStars <linkinstar@foxmail.com>