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

Implement sorting that accounts for nulls #28

Open
Martoon-00 opened this issue Jun 17, 2021 · 0 comments
Open

Implement sorting that accounts for nulls #28

Martoon-00 opened this issue Jun 17, 2021 · 0 comments
Labels
good first issue Good for newcomers

Comments

@Martoon-00
Copy link
Member

Martoon-00 commented Jun 17, 2021

Description

There is a TODO that hangs for quite a long time already.

Namely, in sorting, if some field allows null, it should be possible to specify whether these nulls should appear at the beginning or at the end. beam-postresql allows us to specify this, so SortingParams can allow that too.

A good place to start from: uncomment this code.

Acceptance criteria

  • A concise syntax for API is provided. +date? vs +?date, something else?
  • User can specify nulls sorting only for fields of Maybe X type, otherwise server rejects that.
  • All necessary modules are updated among the following
    • Servant.Util.Sorting.*
    • Servant.Util.Dummy.Sorting
    • Servant.Util.Beam.Postgres.Sorting
  • Parameter constructors for client handlers are added (in *.Sorting.Construction module).
    Probably a sane interface to aim at: nullsFirst asc #field or nullsLast desc #field.
  • Tests are extended to cover the nulls sorting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant