Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueryHelper::filter should take a ConditionWhere as argument #2

Closed
nitnelave opened this issue May 17, 2021 · 2 comments
Closed

QueryHelper::filter should take a ConditionWhere as argument #2

nitnelave opened this issue May 17, 2021 · 2 comments

Comments

@nitnelave
Copy link

Right now, filter takes a simpleExpr as argument, which can be combined into more complex boolean statements with .and and .or, but I think it would be a better interface (and clearer, and more consistent) if it took a sea_query::query::condition::ConditionWhere (or rather an Into<ConditionWhere>).

@tyt2y3
Copy link
Member

tyt2y3 commented May 19, 2021

Thank you for your suggestion. But may be it is not the best to 'overload' filter, because there is a semantic difference: filter() can be called many times, but condition() can be called once only.
I tried to use 'compile time state machine' to guard against this, but it inevitably complicates the interface.
So may be I keep it simple for now.

@tyt2y3
Copy link
Member

tyt2y3 commented May 24, 2021

I think I solved this problem. By allowing cond_where to be called multiple times (SeaQL/sea-query@ef6ac3b), and_where and cond_where actually behaves the same now.

@tyt2y3 tyt2y3 closed this as completed May 26, 2021
SebastienGllmt pushed a commit to dcSpark/sea-orm that referenced this issue Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants