Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace
left_outer_queriable!
with a more generic blanket impl
All of the queriable macros related to joins have caused issues, since they are invalid via the orphan rules for coherence that exist today. While I think we can relax those once specialization lands, or work around it doing something ugly like this: d65df55, neither of those solutions are great right now. This should remove the last blocker that makes this library impossible to use in other crates. We still need to work around the trait coherence rules for the `SelectableColumn` impls in `joinable!`, but that's a much more livable workaround, as it will go away entirely once either specialization or rust-lang/rfcs#1268 lands, as I can replace that with a full blanket impl in the crate itself. Once concern I do have is that we aren't doing much to enforce the relationship between models. One thing that was already true, but is coming to the forefront of my mind is that there's nothing to stop you from doing `users.inner_join(posts).select((users::id, posts::title))` and collecting that into `User { id: i32, name: String }`. Do we even need to care though? Would caring be too tightly conflating the concept of a record and a row from a specific table? Is this ever a case that would be easy to accidentally get wrong? I don't so at this time, you'd have to be pretty specific to get it wrong. I think this is probably fine. Once we add the work-around for the `SelectableColumn` stuff, we can move the rest of the integration tests into the tests directory, and start looking at how places like crates.io might use this library.
- Loading branch information