Replies: 1 comment
-
Seems like this suggests using a raw query because of the select as part of the from clause, not because of the Otherwise we are open to receive a PR here, as long as it includes tests + documentation and supports all build-in backends where this feature is provided by the database implementation. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently (as far as I can find) there is no support for
COUNT(DISTINCT(column))
in Diesel. There's mention of it on Gitter over 4 years ago, I couldn't find the issue that was to be created, however. This SO question from 2018 says to use a raw query.Looking at the implementation of
count
andcount_star
it doesn't seem like it'd be particularly difficult so I'd be quite open to making a PR if welcome. It seems likecount_distinct
would be best (i.e. a single function rather thancount(distinct(column))
as distinct would never be used elsewhere.Not overly familiar with whether the syntax is universally the same though, ANSI seems to use
DISTINCT column
while MySQL usesDISTINCT(column)
.Beta Was this translation helpful? Give feedback.
All reactions