Skip to content

Revert "Simplify boolean filter" #1907

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

Merged
merged 1 commit into from
Apr 30, 2018
Merged

Conversation

teohhanhui
Copy link
Contributor

Reverts #1905

A value is a value, not a literal. If we go by this logic, then we'll use literals for many other things too, which would of course also be wrong.

@bendavies
Copy link
Contributor

I'm not really sure what you mean by A value is a value, not a literal.
It's always true or false in this instance.

@teohhanhui
Copy link
Contributor Author

Yes, and that true or false, despite it being only 1 of 2 possible values, are still values. My objection is for treating a value as a literal. It means the DBMS will have to generate 2 separate prepared statements for the same query that differs only by this boolean value.

@teohhanhui
Copy link
Contributor Author

You may not notice or care about the implication of that, but imagine other use cases where there are many boolean filters and the combination quickly grows out of control.

@bendavies
Copy link
Contributor

👍 thanks for the explanation

Copy link
Member

@soyuka soyuka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm 👍 for keeping parameter bindings :p

@dunglas dunglas merged commit 592af01 into 2.2 Apr 30, 2018
@dunglas dunglas deleted the revert-1905-simplify-boolean-filter branch April 30, 2018 12:54
@dunglas
Copy link
Member

dunglas commented Apr 30, 2018

We should benchmark both, I guess not using parameters not the class generating a random one, and let the DBMS prepare 2 different requests is faster.

@bendavies
Copy link
Contributor

I'd guess it would be immeasurable.

teohhanhui pushed a commit to teohhanhui/api-platform-core that referenced this pull request May 2, 2018
…mplify-boolean-filter

Revert "Simplify boolean filter"
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

Successfully merging this pull request may close these issues.

5 participants