Better API for `Expr::sort(bool, bool); // acktually BOOL BOOL`
- Dominant language
- Rust
- Stars
- 9.3k
- Forks
- 2.4k
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 344
Description
Current implementation:
```rust
// all docs about `sort` is always followed by a comment
col("a").sort(true, false); // yeah but a bit no
col("a").sort(false, true); // no but also yeah
col("a").sort(true, true); // hell yeah
col("a").sort(false, false); // hell no
```
vs.
Suggested implementation:
```rust
// pick a better poison
col("a").sort(SortOpt::AscNullFirst); // can't believe
col("a").sort(SortOpt{ asc: true, null_first: false }); // you guessed it
col("a").sort().asc().null_first(); // without comments!
```
Contributor guide
Research direction
Start at the Expr::sort(bool, bool) API and compare the proposed SortOpt and builder-style alternatives shown in the issue. Clarify which API is wanted, then identify the affected callers and validation coverage; done means an agreed replacement for the ambiguous boolean arguments with its behavior covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100