Make JoinWithImplicitOnClause and joins::Inner externally accessible as a sealed trait
#4942
Replies: 2 comments 5 replies
-
|
I would like to see an specific example of code that cannot expressed without these bounds. As written before in the relevant PR I would not want to expose this due to #3223. We might need to change these internals to address that issue fully. Now I'm open to discuss this if someone can demonstrate that solving #3223 will not require any changes to the trait/type structure for joins. |
Beta Was this translation helpful? Give feedback.
-
|
Alternatively to re-exporting, it could be possible to define a pub trait InnerJoinDsl<Rhs> {
fn inner_join(self, right: Rhs) -> diesel::helper_types::InnerJoin<Lhs, Rhs>;
}
impl<Lhs, Rhs> InnerJoinDsl<Rhs> for Lhs
where
Lhs: diesel::QueryDsl
+ diesel::query_dsl::JoinWithImplicitOnClause<Rhs, diesel::query_source::inner::Inner>,
{
fn inner_join(self, right: Rhs) -> diesel::helper_types::InnerJoin<Lhs, Rhs> {
<Lhs as diesel::QueryDsl>::inner_join(self, right)
}
}Positioned somewhere where This option should not constrain any change to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Backend
PostgreSQL, MySQL, SQLite, Others
What do you want to add to diesel?
At this time,
JoinWithImplicitOnClauseis a non exported public trait andjoins::Inneris private. This makes it impossible to constraint that a genericThas theinner_joinmethod, as it currently requiresT: JoinWithImplicitOnClause<Rhs, joins::Inner>.I would suggest to:
JoinWithImplicitOnClausea sealed externally accessible traitjoins::InnerImplementation notes
No response
Additional details
No response
Checklist
Beta Was this translation helpful? Give feedback.
All reactions