xorm/dialects
LinkinStars cb851a2f95 Filter support passing context (#2200) (#2270)
```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>
2023-05-31 01:43:24 +00:00
..
dameng.go Change schemas.Column to use int64 (#2160) 2022-07-14 13:55:24 +08:00
dialect.go Add support for go-ora driver (#2215) 2023-02-04 21:24:29 +08:00
driver.go refactor some code (#2000) 2021-07-21 00:12:20 +08:00
filter.go Filter support passing context (#2200) (#2270) 2023-05-31 01:43:24 +00:00
filter_test.go Ignore comments when deciding when to replace question marks. #1954 (#1955) 2021-06-26 19:19:13 +08:00
gen_reserved.sh Move reserve words related files into dialects sub package (#1544) 2020-02-24 10:05:10 +00:00
mssql.go Change schemas.Column to use int64 (#2160) 2022-07-14 13:55:24 +08:00
mssql_test.go Merge core package back into the main repository and split into serval sub packages. (#1543) 2020-02-24 08:53:18 +00:00
mysql.go mysql字段为UNSIGNED时,会导致字段类型无法识别,返回RawBytes,JSON 字段映射为String (#2225) 2023-02-28 23:42:42 +08:00
oracle.go oracle: Fix quotes on DropTableSQL function, add IsSequenceExist function. (#2265) 2023-05-17 09:04:00 +08:00
oracle_test.go Oracle : Local Naming Method (#1515) 2020-03-23 02:03:04 +00:00
pg_reserved.txt Move reserve words related files into dialects sub package (#1544) 2020-02-24 10:05:10 +00:00
postgres.go add delimiters between COMMENT ON COLUMN... for Postgres (#2156) 2022-12-12 18:35:40 +08:00
postgres_test.go Fix postgres driver datasource name parse (#2012) 2021-07-28 10:03:09 +08:00
quote.go Improve quote policy (#1567) 2020-03-06 07:48:32 +00:00
sqlite3.go Add dameng support (#2007) 2021-08-24 13:46:08 +08:00
sqlite3_test.go Merge core package back into the main repository and split into serval sub packages. (#1543) 2020-02-24 08:53:18 +00:00
table_name.go oracle数据库不再拼接AS (#2109) 2022-03-31 23:57:40 +08:00
table_name_test.go Move statement as a sub package (#1564) 2020-02-28 12:29:08 +00:00
time.go Change schemas.Column to use int64 (#2160) 2022-07-14 13:55:24 +08:00