Implement TupleSize for SelectBy so nested selectable tuples load #5240
By looking at this I noticed that it might be that this impl doesn't exist was an explicit decision back the.
The reason might be that ::as_select() generally seeks to enforce that only that type can be loaded from the database, not anything that's compatible in shape. I think that construct would loosen that guarantee. The existing, checked way here is to use <(User, UserName)>::as_select() instead
Codecov Report
:x: Patch coverage is
0% with 1 line in your changes missing coverage. Please review.:white_check_mark: Project coverage is 81.50%. Comparing base (
cb82e6a) to head (48f39a8).:warning: Report is 9 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| diesel/src/type\_impls/tuples.rs | 0.00% | 0 Missing and 1 partial :warning: |
<details><summary>Additional details and impacted files</summary>
@@ Coverage Diff @@
## main #5240 +/- ##
=======================================
Coverage 81.49% 81.50%
=======================================
Files 337 337
Lines 36626 36626
Branches 36626 36626
=======================================
+ Hits 29850 29853 +3
+ Misses 5049 5045 -4
- Partials 1727 1728 +1
| Flag | Coverage Δ | |
|---|---|---|
| mariadb | 76.45% <0.00%> (+0.01%) | :arrow_up: |
| mysql | 76.53% <0.00%> (+0.01%) | :arrow_up: |
| postgres | 80.05% <0.00%> (+0.01%) | :arrow_up: |
| sqlite | 76.17% <0.00%> (+0.01%) | :arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
</details>
:umbrella: View full report in Codecov by Harness.
:loudspeaker: Have feedback on the report? Share it here.
<details><summary> :rocket: New features to boost your workflow: </summary>
</details>
I imagine that your "loosen that guarantee" means having incorrect queries survive compile time. I did found one case regarding the Untyped case, and I do handle it now. I could not find anything else.
Experimentally, before crashing to bed, I started a Opus 5.5 armed with several Qwen 3.8 27b in a container over night to search for related bugs adversarially (I prompted the agent to find an hypothetical bug I claimed is there, so it can get desperate searching for it), as I cannot think of a better fuzzer for it at this time. It could not find one.
If you have any ideas or gut feelings about what could break here, do let me know and I can try to have a look at it or try another run as described above, although I am not sure whether it not finding anything means it is just useless at it.
And the Ubuntu bug I mentioned & patched originally is now getting released next week yay https://bugs.launchpad.net/ubuntu/+source/sqlite3/+bug/2087772
weiznich
LucaCappelletti94
A tuple of
as_select()expressions nested inside another tuple failed to compile unless it was the last element, which also broke wrapping such a select in a custom query like the pagination example from the issue.This was a rare example of vertical brown touch, as I ended up finding a completely unrelated and real bug in Ubuntu while working on this 🤦🏻
Closes #4292