Skip to content

Implement sorting that accounts for nulls #28

@Martoon-00

Description

@Martoon-00

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions