Skip to content

Question: Why is order scoped to model properties only? #78

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

Open
pmooney-socraticworks opened this issue Mar 6, 2025 · 1 comment
Open

Comments

@pmooney-socraticworks
Copy link

From the readme:

The order option format only supports the ['field'] and ['field', 'DESC'] variations (field name and the optional order direction). For example, ordering by an associated model's field won't work.

I'm curious what the limitations are to prevent ordering on associated models' fields. I'd like to use this package, but this is stopping me from integrating it, and was wondering if it was a limitation of sequelize or something else.

@Kaltsoon
Copy link
Owner

Kaltsoon commented Mar 18, 2025

I think it could be technically supported, but I don't have the resources to implement it. The whole parsed cursor structure would change. At the moment the order by configuration field is normalized into format ['fieldName', 'DIRECTION']. Associated models have a bunch of possible formats. Changing the normalization would of course have an effect elsewhere.

I would gladly accept contributions regarding this limitation, but it is simply too much work for me right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants