Add `into_tuple` to `SelectTwo` and `SelectTwoMany`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 9.9k
- Forks
- 734
- Avg merge
- 6h 36m
- Merged PRs (30d)
- 8
Description
Motivation
Currently into_tuple only works on single Select queries. This leads to inconsistencies between the different query types and as such it should be extended to support the SelectTwo and SelectTwoMany queries.
Code like this should work
let res = Email::find_by_id(email_id)
.select_only()
.find_also_related(Thread)
.column(thread::Column::Id)
.into_tuple()
.one(db)
.await?;
Proposed Solutions
into_tuple should work the same as it currently does with Select
Current Workarounds
Currently you can query normally and get a struct in return but getting a tuple directly could help reduce code verbosity.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing into_tuple implementation for Select, then inspect the SelectTwo and SelectTwoMany query entry points. Compare their behavior with Select and identify the relevant tests or examples for tuple results. Done means the shown find_also_related query can call into_tuple and return the expected tuple result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100