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

order_by_desc not working with cursor_by #2376

Open
samuelint opened this issue Oct 1, 2024 · 0 comments
Open

order_by_desc not working with cursor_by #2376

samuelint opened this issue Oct 1, 2024 · 0 comments

Comments

@samuelint
Copy link

samuelint commented Oct 1, 2024

Description

Using order_by_desc is not working with cursor_by.

Steps to Reproduce

// Returned values are `by_asc` even if `by_desc` is specified 
let result = thread::Entity::find()
    .cursor_by(thread::Column::Id)
    .order_by_desc(thread::Column::Id)
    .after(10)
    .before(0)
    .limit(10)
    .all(self.connection.as_ref())
    .await?;
// Not working either 
let result = thread::Entity::find()
    .order_by_desc(thread::Column::Id)
    .cursor_by(thread::Column::Id)
    .order_by_desc(thread::Column::Id)
    .after(10)
    .before(0)
    .limit(10)
    .all(self.connection.as_ref())
    .await?;
// This is working
let result = thread::Entity::find()
    .order_by_desc(thread::Column::Id)
    .all(self.connection.as_ref())
    .await?;

Expected Behavior

Data sorted by desc.

Actual Behavior

order_by_desc is not applied.

Reproduces How Often

100%

Workarounds

None for the moment

Reproducible Example

#2377

Versions

│   └── sea-orm-migration v0.12.15
│       ├── sea-orm v0.12.15
│       │   ├── sea-orm-macros v0.12.15 (proc-macro)
│       │   │   ├── sea-bae v0.2.0 (proc-macro)
│       │   ├── sea-query v0.30.7
│       │   │   ├── sea-query-derive v0.4.1 (proc-macro)
│       │   ├── sea-query-binder v0.5.0
│       │   │   ├── sea-query v0.30.7 (*)
│       ├── sea-orm-cli v0.12.15
│       │   ├── sea-schema v0.14.2
│       │   │   ├── sea-query v0.30.7 (*)
│       │   │   └── sea-schema-derive v0.2.0 (proc-macro)
│       ├── sea-schema v0.14.2 (*)
├── sea-orm v0.12.15 (*)
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

No branches or pull requests

1 participant