Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a sort_fn in GritQL #230

Merged
merged 2 commits into from
Aug 8, 2024
Merged

feat: add a sort_fn in GritQL #230

merged 2 commits into from
Aug 8, 2024

Conversation

morgante
Copy link
Contributor

@morgante morgante commented Aug 7, 2024

@@ -0,0 +1,23 @@
# Sort function

The `sort($list)` function sorts a list of items in ascending order, based on the lexical order of the items.
Copy link

Choose a reason for hiding this comment

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

Could be good to include test case for integers to make sure there's no string casting that produces a lexical sort

[2, 10, 3]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actually intentionally a lexical sort.

@morgante morgante merged commit e069cde into main Aug 8, 2024
5 checks passed
@morgante morgante deleted the add-sort branch August 8, 2024 01:55
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.

Add a sort() built-in function
2 participants