Skip to content

fix order by table alias#16

Merged
DominusKelvin merged 5 commits into
developfrom
feat/fix-order-by-table-alias
Jan 14, 2026
Merged

fix order by table alias#16
DominusKelvin merged 5 commits into
developfrom
feat/fix-order-by-table-alias

Conversation

@DominusKelvin

Copy link
Copy Markdown
Member

Fixes #14

When the primary key column name starts with underscore (e.g., '_id'),
the sequence name becomes 'tablename__id_seq' (double underscore).
The previous parsing logic couldn't handle this edge case.

Now we progressively try shorter table name prefixes until we find
an existing table, which correctly handles cases like:
- 'alter__id_seq' -> table 'alter', column '_id'
- 'invoice_items_id_seq' -> table 'invoice_items', column 'id'
@DominusKelvin
DominusKelvin merged commit 6f73cff into develop Jan 14, 2026
4 checks passed
@DominusKelvin
DominusKelvin deleted the feat/fix-order-by-table-alias branch January 14, 2026 17:50
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

Successfully merging this pull request may close these issues.

ORDER BY uses wrong table name in JOIN queries

1 participant