Repository navigation
feat(postgres): add expression-level COLLATE support - #40
Merged
Merged
Conversation
Add PostgreSQL collation validation and dialect formatting so COLLATE expressions remain schema-aware and safe for query composition. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Return the PostgreSQL collation SQL representation from validate_collation_name so COLLATE formatting validates backend-specific names in one place. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Annotate validate_collation_name with CollationName so the PostgreSQL dialect hook documents the structured collation argument it receives. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adapt COLLATE validation to consume the full CollateExpression while preserving PostgreSQL schema-qualified collation handling. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/v1.0.0.dev15 #40 +/- ##
========================================================
+ Coverage 71.03% 71.08% +0.05%
========================================================
Files 231 232 +1
Lines 10240 10272 +32
Branches 1617 1621 +4
========================================================
+ Hits 7274 7302 +28
- Misses 2439 2442 +3
- Partials 527 528 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
7 of 12 tasks
vistart
added a commit
that referenced
this pull request
Jun 15, 2026
* feat(postgres): add expression-level COLLATE support Add PostgreSQL collation validation and dialect formatting so COLLATE expressions remain schema-aware and safe for query composition. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * refactor(postgres): validate COLLATE names via dialect hook Return the PostgreSQL collation SQL representation from validate_collation_name so COLLATE formatting validates backend-specific names in one place. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * style(postgres): type COLLATE validation hook parameter Annotate validate_collation_name with CollationName so the PostgreSQL dialect hook documents the structured collation argument it receives. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * refactor(postgres): accept collation expression in validation Adapt COLLATE validation to consume the full CollateExpression while preserving PostgreSQL schema-qualified collation handling. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore: add changelog fragment for PR #40 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.



Description
Adds PostgreSQL expression-level
COLLATEsupport for SQL value expressions.This introduces PostgreSQL collation name validation, integrates dialect-level collation formatting with the core
CollateExpressionhook, and adds backend-specific tests for plain, quoted, and schema-qualified collation names.Adds # (issue)
Type of change
feat: A new featuredocs: Documentation only changes (if related to the new feature)perf: A code change that improves performance (if part of the feature)test: Adding missing tests or correcting existing tests (for the new feature)chore: Changes to the build process or auxiliary tools and libraries suchs as documentation generation (if related to the new feature)ci: Changes to our CI configuration files and scripts (if related to the new feature)build: Changes that affect the build system or external dependencies (if related to the feature)revert: Reverts a previous commitBreaking Change
Applicable
rhosocial-activerecordVersion Range:Compatible with the core version that provides expression-level
CollateExpressiondialect hooks.Related Repositories/Packages
This PR depends on the corresponding core
python-activerecordCOLLATE support, merged in PR #97. Related backend plugin PRs should use the sameCollateExpression-based validation contract.Testing
Test Plan:
Checklist
README.md, etc.).changelog.d/<issue_number>.<type>.md).Additional Notes
PostgreSQL allows schema-qualified collation names. The validator accepts an optional
schemacollation option and quotes each identifier segment through the dialect identifier quoting path.