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

Fixed #11634 - Sort by numeric columns for numeric custom fields #15518

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

snipe
Copy link
Owner

@snipe snipe commented Sep 17, 2024

This allows us to sort numerically on numeric custom fields. (Not 100% sure whether or not this could break on pgSQL, but seems to be okay on sqlite (though admittedly, we don't strongly test ordering currently.)

Fixes #15458 and #11634

Copy link

what-the-diff bot commented Sep 17, 2024

PR Summary

  • Improved Customized Sorting: The software now has an improved ability to organize data according to specific criteria. This is particularly useful when dealing with numerical data.
  • Adaptive Sorting Feature: Depending on the type of data it's dealing with, whether numerical or otherwise, the software can now adjust its sorting method for better performance and compatibility with databases.

Copy link
Collaborator

@marcusmoore marcusmoore left a comment

Choose a reason for hiding this comment

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

Interesting fix. Works for me (mysql) 👍🏾

Copy link
Collaborator

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

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

I think this solves the problem pretty well for us like this. I'm a little uncomfortable with the * 1 thing, but it looks like the SQL-standard CAST(blah AS blah) syntax differs with each database (yuck), and this should hopefully be at least a little bit more standard. So I think it's a very clever way to handle this problem - the ways I were thinking about doing this were going to be much, much worse. So you've got a very clever, database-agnostic solution going here. Nice work!

@snipe snipe merged commit 454796e into develop Sep 19, 2024
9 checks passed
@snipe snipe deleted the sort_by_numeric_custom_fields branch September 19, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants