sea-orm
sea-orm copied to clipboard
feat: implement `IntoSimpleExpr` for `FunctionCall`, `ColumnRef`, `Keyword` and `CaseStatement`
PR Info
- Closes https://github.com/SeaQL/sea-orm/issues/1601
Changes
- [x] Implement
IntoSimpleExprforFunctionCall,ColumnRef,KeywordandCaseStatement
@billy1624 hello! I think this is not all types... For example:
- https://docs.rs/sea-query/latest/sea_query/extension/postgres/enum.PgFunction.html
- https://docs.rs/sea-query/latest/sea_query/extension/postgres/struct.PgFunc.html
- https://docs.rs/sea-query/latest/sea_query/extension/sqlite/trait.SqliteExpr.html
Hey @ikrivosheev, I think we shouldn't implement IntoSimpleExpr for the types below.
- https://docs.rs/sea-query/latest/sea_query/extension/postgres/enum.PgFunction.html (will not be used directly, instead user should construct it via
PgFunc) - https://docs.rs/sea-query/latest/sea_query/extension/postgres/struct.PgFunc.html (stateless and each method of it returns a
FunctionCallwhich already implementedIntoSimpleExpr - https://docs.rs/sea-query/latest/sea_query/extension/sqlite/trait.SqliteExpr.html (this is a trait which extend the functionality of
Expression)
This is a rather benign addition, so may be we can add a few unit tests? Just to make sure it compiles.
Hey @ikrivosheev, I think we shouldn't implement
IntoSimpleExprfor the types below.1. https://docs.rs/sea-query/latest/sea_query/extension/postgres/enum.PgFunction.html (will not be used directly, instead user should construct it via `PgFunc`) 2. https://docs.rs/sea-query/latest/sea_query/extension/postgres/struct.PgFunc.html (stateless and each method of it returns a `FunctionCall` which already implemented `IntoSimpleExpr` 3. https://docs.rs/sea-query/latest/sea_query/extension/sqlite/trait.SqliteExpr.html (this is a trait which extend the functionality of `Expression`)
Thank you for explain!
This is a rather benign addition, so may be we can add a few unit tests? Just to make sure it compiles.
Just added a few test cases. Please check :)