Skip to content

pgcql: sort support#40

Merged
adamdickmeiss merged 2 commits intomainfrom
CROSSLINK-228-pgcql-sorting
Mar 6, 2026
Merged

pgcql: sort support#40
adamdickmeiss merged 2 commits intomainfrom
CROSSLINK-228-pgcql-sorting

Conversation

@adamdickmeiss
Copy link
Contributor

@adamdickmeiss adamdickmeiss commented Mar 5, 2026

https://index-data.atlassian.net/browse/CROSSLINK-228

This is breaking in two ways.

  1. The Query interface was modified, so that GetOrderByFields returns string list.
  2. A new method Sort was added to the Field interface.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/Query APIs 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 BY generation.

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.

@adamdickmeiss adamdickmeiss merged commit a33d633 into main Mar 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants