Skip to content

Conversation

@vmihailenco
Copy link
Member

No description provided.

@vmihailenco vmihailenco merged commit 2ad0521 into master Oct 20, 2025
5 of 21 checks passed
@vmihailenco vmihailenco deleted the feat/sort-dir branch October 20, 2025 11:02

//------------------------------------------------------------------------------

type SortDir string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to call this type Order? I know "sorting direction" is a valid expression, but I find that bun.OrderDesc reads better and is perhaps a tad more intuitive:

.OrderBy("year", bun.OrderDesc)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the first glance Dir also made me think of the word "directory" rather than "direction", similarly to fs.Dir from the std

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what LLM also suggested, but I wanted to avoid confusion with Order("foo ASC") and OrderBy("foo", SortDirAsc). So:

  • order is col + " " + direction
  • SortDir is just direction

Maybe I am over-complicating it... Need to check what other libs are using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants