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

Specify sorting order in schema #197

Open
VeaaC opened this issue Nov 9, 2020 · 0 comments
Open

Specify sorting order in schema #197

VeaaC opened this issue Nov 9, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@VeaaC
Copy link
Collaborator

VeaaC commented Nov 9, 2020

Flatdata archives often utilize sorted resources, and a binary search to find elements withing those. It is easy to mess up the sorting when creating archive, though, leading to (sometimes) subtle bugs.

In order to avoid such bugs, it would be a nice feature if one could specify the ordering criteria for a collection directly in the flatdata specification.
This may not be possible for all collections (i.e., when the ordering criteria are not simple). But it could be helpful for most cases.

When the ordering criteria are specified, flatdata could auto-generate:

  • method(s) to find an element (or range of elements) in the collection
  • method(s) to validate sort order (e.g., when serializing a collection, flatdata generated code could throw an exception of the items being serialized are not in correct order).
@VeaaC VeaaC added the enhancement New feature or request label Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant