Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds CQL sortby support to the pgcql package by generating SQL ORDER BY clauses and exposing ordering metadata on the parsed query object.
Changes:
- Extend
Field/QueryAPIs to support sorting and order-by field introspection. - Implement parsing and SQL generation for CQL sort specifications (
sortby .../sort.*). - Update unit/integration tests and README usage examples to include
ORDER BYgeneration.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pgcql/pgx_test.go | Integration tests now execute queries with ORDER BY appended. |
| pgcql/pgcql_test.go | Adds test coverage for order-by fields and updates parsing expectations to include ordering. |
| pgcql/pgcql.go | Public interfaces updated to include sorting support and order-by metadata. |
| pgcql/pg_query.go | Implements sort spec parsing and ORDER BY SQL clause generation. |
| pgcql/pg_field_common.go | Provides default sortable expression (column) for fields embedding FieldCommon. |
| pgcql/pg_combo.go | Explicitly marks combo fields as non-sortable. |
| README.md | Updates example usage to include ORDER BY in generated SQL. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
JanisSaldabols
approved these changes
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://index-data.atlassian.net/browse/CROSSLINK-228
This is breaking in two ways.
Queryinterface was modified, so thatGetOrderByFieldsreturns string list.Sortwas added to theFieldinterface.