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

Support COUNT(0) as well as COUNT(1) #1260

Closed
tunetheweb opened this issue Aug 9, 2021 · 0 comments · Fixed by #1263
Closed

Support COUNT(0) as well as COUNT(1) #1260

tunetheweb opened this issue Aug 9, 2021 · 0 comments · Fixed by #1263
Labels
enhancement New feature or request

Comments

@tunetheweb
Copy link
Member

L047 allows enforcing consistency of use of COUNT(*) or COUNT(1).

However some teams use COUNT(0) instead of either. Personally COUNT(1) has always made more sense to me, but that's by the by as sometimes you have to swallow your own preferences to follow team style.

So I would like to add the option to be able to enforce COUNT(0). I could see this being done in two ways:

  • The easiest would be to add a prefer_count_0 flag similar to prefer_count_1, and then decide a precedence if both are set (I'd suggest prefer_count_1 for backwards compatibility).
  • Perhaps a cleaner way (in terms of config anyway) would be to to change this to a prefer_count="1" option, that could also be set to "0", though that would be a breaking change (unless you supported both - in which case you might as well just go with the first option).

Any thoughts on this?

Happy to tackle this one myself btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant