Cursor on joined table
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 9.9k
- Forks
- 735
- Avg merge
- 6h 36m
- Merged PRs (30d)
- 8
Description
Description
SeaORM assumes that column passed in cursor_by is in the original table.
Steps to Reproduce
- Select from table
- Join with another table
- use
cursor_byusing column from second table
Expected Behavior
Use table that I've specified.
Actual Behavior
SeaOrm assumes that column that I want to cursor_by is inside main table.
Reproduces How Often
Always.
Workarounds
I am not aware of any.
Reproducible Example
gallery_media::Entity::find()
.left_join(galleries::Entity)
.cursor_by(galleries::Column::Score);
This throws following error
Query Error: error returned from database: 1054 (42S22): Unknown column 'gallery_categories.score' in 'order clause'
Versions
├── 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-binder v0.5.0
│ │ ├── sea-query v0.30.7 (*)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Rust reproducible example using gallery_media::Entity, left_join, and cursor_by(galleries::Column::Score), then trace how cursor_by builds the ORDER BY clause. Reproduce the MySQL error and verify the completed behavior uses the specified joined-table column without producing an unknown-column error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, rust, sql
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100