Open Zstorm999 opened 1 month ago
Hey @Zstorm999 @weiznich , can I work on this?
@PratikFandade Sure, just let us know if you need some help there. Also expect to handle some rather complex trait relations there.
I found the declaration of the SelectBy in this code, if I'm correct the SelectBy should be compatible using this right? https://github.com/diesel-rs/diesel/blob/master/diesel/src/query_dsl/load_dsl.rs#L208-L218
Do we make a new impl for the tuples of SelectBy?
When building a custom QueryFragment, it seems some method do not behave the same when using the standard
SelectBy
trait or a custom implementation.This happens in particular when trying to query two structs inside a tuple (see example below).
Minimum reproduction
```rust use std::error::Error; use diesel::{ pg::Pg, query_builder::{Query, QueryFragment, QueryId}, query_dsl::methods::{LoadQuery, SelectDsl}, sql_types::BigInt, Connection, PgConnection, QueryResult, Queryable, RunQueryDsl, Selectable, SelectableHelper, }; pub trait Paginate: Sized { fn paginate(self) -> PaginationHere is the error produced by the compiler:
cargo error message
``` error[E0277]: the trait bound `(diesel::expression::select_by::SelectByOriginally posted by @Zstorm999 in https://github.com/diesel-rs/diesel/discussions/4234#discussioncomment-10557332
In particular, it seems that this impl https://github.com/diesel-rs/diesel/blob/79399de749dcc24283c2f2ddcd46be90042eb91a/diesel/src/type_impls/tuples.rs#L371-L384
and this one https://github.com/diesel-rs/diesel/blob/79399de749dcc24283c2f2ddcd46be90042eb91a/diesel/src/type_impls/tuples.rs#L342-L349
do not behave correctly together