Repository navigation
feat(dialect): require version adaptation before using Postgres dialect - #37
Merged
Merged
Conversation
PostgresDialect now defaults to version=None, requiring introspect_and_adapt() or explicit version before version-dependent features can be used. This prevents silent SQL errors from incorrect version assumptions. - Change PostgresDialect.__init__ default version to None - Remove hardcoded (9, 6, 0) from backend dialect construction - Update tests to use explicit version (13, 0, 0) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/v1.0.0.dev14 #37 +/- ##
=====================================================
Coverage 68.74% 68.74%
=====================================================
Files 230 230
Lines 10058 10059 +1
Branches 1599 1600 +1
=====================================================
+ Hits 6914 6915 +1
Misses 2621 2621
Partials 523 523
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Merged
vistart
added a commit
that referenced
this pull request
May 29, 2026
…ct (#37) * feat(dialect): require version adaptation before using Postgres dialect PostgresDialect now defaults to version=None, requiring introspect_and_adapt() or explicit version before version-dependent features can be used. This prevents silent SQL errors from incorrect version assumptions. - Change PostgresDialect.__init__ default version to None - Remove hardcoded (9, 6, 0) from backend dialect construction - Update tests to use explicit version (13, 0, 0) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore: add changelog fragment for PR #37 --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
7 of 12 tasks
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
PostgresDialectnow defaults toversion=None, requiringintrospect_and_adapt()or explicit version before version-dependent features can be used. This prevents silent SQL errors from incorrect version assumptions.Problem: Backend dialects had default versions that could mismatch actual server capabilities, causing silent SQL errors when using features the server doesn't support.
Solution: Part of the dialect version guarding initiative across the rhosocial-activerecord ecosystem. Dialects now default to
Noneversion and throwDialectNotAdaptedExceptionat use time.Key Changes:
PostgresDialect.__init__default version toNone(9, 6, 0)from backend dialect construction(13, 0, 0)Type of change
feat: A new featuredocs: Documentation only changesperf: A code change that improves performancetest: Adding missing tests or correcting existing testschore: Changes to the build process or auxiliary toolsci: Changes to our CI configuration files and scriptsbuild: Changes that affect the build system or external dependenciesrevert: Reverts a previous commitBreaking Change
Impact on End-Users:
No backward-incompatible changes are expected for typical end-user applications. The
context()andconfigure()methods continue to work as before, automatically callingintrospect_and_adapt().Impact on Backend Developers:
Custom backend implementations must ensure dialect version is set either:
PostgresDialect(version=(X, Y, Z))introspect_and_adapt()which sets the version from server detectionApplicable
rhosocial-activerecordVersion Range:Related Repositories/Packages
DialectNotAdaptedExceptionand version guarding logic (PR #89)Testing
Test Plan:
(13, 0, 0)Checklist
Commits in this PR
965ea3e- feat(dialect): require version adaptation before using Postgres dialect