Skip to content

SQL feature provider: add nullOrder option#330

Merged
cportele merged 1 commit intomasterfrom
issue-1344
Mar 1, 2025
Merged

SQL feature provider: add nullOrder option#330
cportele merged 1 commit intomasterfrom
issue-1344

Conversation

@cportele
Copy link
Contributor

This change adds a query generation option nullOrder to SQL feature providers to control the sort order for columns with null values. If no value is provided, the default order of the database applies. For last, the rows with null always are last for both ascending and descending. For first, the rows with null are always first. This is implemented by adding NULLS LAST or NULLS FIRST to each sort field.

Example:

queryGeneration: 
  nullOrder: last

@cportele cportele requested a review from azahnen as a code owner February 27, 2025 07:10
@cportele
Copy link
Contributor Author

@azahnen

This should be ready for review.

If configured, the order is specified for all sort fields including the sort id field (which never should be null, so for these cases the addition has no effect).

I tested it with the "vineyards" API, by adding the option and by adding "village_info" to the sortables.

Copy link
Collaborator

@azahnen azahnen left a comment

Choose a reason for hiding this comment

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

Works as expected.

@cportele cportele merged commit 97ef2f1 into master Mar 1, 2025
1 check passed
@cportele cportele deleted the issue-1344 branch March 1, 2025 12:54
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