Replies: 3 comments 4 replies
-
Thanks for writing this proposal. I think you describe two distinct things here: For diesel/diesel/src/expression/count.rs Lines 99 to 158 in 7e2cd73 and essentially remove the The general expression part is more complicated as we would need to restrict it to a specific set of methods, although we likely could do something like with the sql type specific expression method extensions like Both features would be happily accepted as contribution if they contain a reasonable set of (doc-)tests + documentation. In both cases I cannot really comment on the complexity of the implementation as that would require starting the implementation itself. |
Beta Was this translation helpful? Give feedback.
-
I really want to be able to use the type |
Beta Was this translation helpful? Give feedback.
-
Sorry to necro a seemingly dead thread but all roads seem to lead here on this topic. I wish to do something like this: Has anything come of this topic in terms of added functionality, or is there another way of doing this? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I asked on Gitter the other day about queries such as the following, what MySQL coins 'row comparison' (see more here). This query essentially matches rows/tuples in their entirety against the selected
IN
query columns.I've started hitting up another situation where that would be useful, using multiple columns in
COUNT(DISTINCT ...)
queries, such as the following, which counts unique combinations of the two columns.Ideally, I'd like to do the following:
Most of these functions are only implemented for the
SingleValue
trait, what I'd like to propose is another trait called, for example,TupleValue
that represents multiple columns, i.e. would be implemented for all(A, B, C, ...)
whereA: SingleValue, B: SingleValue, ...
, for allT: SingleValue
. This trait would then be used in places where multiple columns are possible.I am happy to implement such changes if realistic in complexity, breadth and if actually desired. I'm essentially also unsure of how destructive this would be. If it's more appropriate, I can just make such functionality with personal structs/trait in my own code (as I've done with the row comparison case).
Beta Was this translation helpful? Give feedback.
All reactions