Problem with creating a generic when using a method that uses Grouped
#3968
Unanswered
vincent-herlemont
asked this question in
Q&A
Replies: 1 comment
-
I generally advice not to write generic code involving diesel outside of fundamental library implementations. You end up with complicated hard to maintain generic code. It's usually easier to follow the patterns described in the "Composing Applications" guide. These types are private as we don't want to expose them as part of the stable API as their representation can change at any point. You usually want to use the type defs from |
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
-
I'm trying to make a generic to select all the posts (example taken from the official diesel site) that belong to a list of IDs. Here is what it looks like with concrete types (all works ✅ ):
Now, I want to use generic types, first the IDs which I will name PKS (for primary keys).
Here is my attempt (not working ❌ ):
You can see my
??
because that's where I don't know what to put.Related error:
This error happens because
EqAny
useGrouped
and I cannot access the structdiesel::expression::Grouped
because it is private to the crate.Do you have any ideas to put me on the right way?
Beta Was this translation helpful? Give feedback.
All reactions