Repository navigation
fix: fill all PostgreSQL index and DDL feature coverage gaps - #39
Merged
Merged
Conversation
- Add PostgresDropIndexExpression with CONCURRENTLY support (PG18+) - Add PostgresAlterIndexExpression with all 8 ALTER INDEX action types - Add PostgresIndexMixin protocol method overrides (7 methods) - Add format_drop/alter_index_statement to PostgresIndexMixin - Add format_add/drop_index_action UnsupportedFeatureError stubs in dialect - Register 3 new expression/dialect pairs in protocol conformance tests - Add 21 new test cases covering all CREATE INDEX options, ALTER INDEX error paths, DROP INDEX CONCURRENTLY, and WHERE expression protocol
- Add supports_trigger/supports_create_trigger/supports_drop_trigger to PostgresTriggerMixin (previously only in dialect.py) - Add supports_create_index/supports_drop_index/supports_unique_index/ supports_index_if_not_exists/supports_index_if_exists to PostgresIndexMixin - Add explicit fulltext method overrides returning False/UnsupportedFeatureError - Fix supports_index_if_not_exists version gate in dialect.py (PG 9.5+) - Add corresponding unit tests for all new methods (16 new tests) - All 489 related tests pass without regression
- Add supports_if_not_exists_table (PG 9.5+), supports_if_exists_table, supports_temporary_table, supports_table_partitioning (PG 10+), supports_table_tablespace to PostgresTableMixin - Add version gates to dialect.py for if_not_exists_table and table_partitioning to match mixin - Add 8 test cases for all table feature detection methods - 425 related tests pass without regression
- Add 10 unpaired extension protocols to POSTGRES_PROTOCOL_MIXIN_PAIRS for forward/reverse coverage verification - All 517 related tests pass without regression
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/v1.0.0.dev15 #39 +/- ##
========================================================
+ Coverage 69.29% 70.44% +1.15%
========================================================
Files 231 231
Lines 10088 10234 +146
Branches 1593 1613 +20
========================================================
+ Hits 6990 7209 +219
+ Misses 2569 2510 -59
+ Partials 529 515 -14
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:
|
- Add pragma: no cover to protocol ellipsis bodies and TYPE_CHECKING blocks (matching core project convention with per-line markers) - Add direct mixin tests for PostgresIndexMixin, PostgresTableMixin, and PostgresTriggerMixin (not through PostgresDialect overrides) - Add expression column, INCLUDE error paths, and unsupported ALTER INDEX action tests for index mixin - Add trigger WITH condition expression test - Add trigger with no-level (FOR EACH omitted) test - All 5 files now at 100% statement and branch coverage
|
7 of 12 tasks
vistart
added a commit
that referenced
this pull request
Jun 15, 2026
* fix: fill all PostgreSQL index feature coverage gaps - Add PostgresDropIndexExpression with CONCURRENTLY support (PG18+) - Add PostgresAlterIndexExpression with all 8 ALTER INDEX action types - Add PostgresIndexMixin protocol method overrides (7 methods) - Add format_drop/alter_index_statement to PostgresIndexMixin - Add format_add/drop_index_action UnsupportedFeatureError stubs in dialect - Register 3 new expression/dialect pairs in protocol conformance tests - Add 21 new test cases covering all CREATE INDEX options, ALTER INDEX error paths, DROP INDEX CONCURRENTLY, and WHERE expression protocol * fix: complete remaining DDL feature gaps in trigger and index mixins - Add supports_trigger/supports_create_trigger/supports_drop_trigger to PostgresTriggerMixin (previously only in dialect.py) - Add supports_create_index/supports_drop_index/supports_unique_index/ supports_index_if_not_exists/supports_index_if_exists to PostgresIndexMixin - Add explicit fulltext method overrides returning False/UnsupportedFeatureError - Fix supports_index_if_not_exists version gate in dialect.py (PG 9.5+) - Add corresponding unit tests for all new methods (16 new tests) - All 489 related tests pass without regression * fix: add missing table feature methods to PostgresTableMixin - Add supports_if_not_exists_table (PG 9.5+), supports_if_exists_table, supports_temporary_table, supports_table_partitioning (PG 10+), supports_table_tablespace to PostgresTableMixin - Add version gates to dialect.py for if_not_exists_table and table_partitioning to match mixin - Add 8 test cases for all table feature detection methods - 425 related tests pass without regression * test: add 10 missing extension protocol-mixin pairs to conformance tests - Add 10 unpaired extension protocols to POSTGRES_PROTOCOL_MIXIN_PAIRS for forward/reverse coverage verification - All 517 related tests pass without regression * chore: add changelog fragment for PR #39 * test: achieve 100% coverage on 5 target files - Add pragma: no cover to protocol ellipsis bodies and TYPE_CHECKING blocks (matching core project convention with per-line markers) - Add direct mixin tests for PostgresIndexMixin, PostgresTableMixin, and PostgresTriggerMixin (not through PostgresDialect overrides) - Add expression column, INCLUDE error paths, and unsupported ALTER INDEX action tests for index mixin - Add trigger WITH condition expression test - Add trigger with no-level (FOR EACH omitted) test - All 5 files now at 100% statement and branch coverage
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
This PR fills all remaining PostgreSQL index and DDL feature coverage gaps across protocols, mixins, expressions, and tests. All PostgreSQL-supported
supports_*()methods now return correct values from their respective mixins, and the protocol conformance test suite covers all 54 PostgreSQL-specific protocol-mixin pairs.Changes include:
Index DDL (8bfb608):
PostgresDropIndexExpressionwith CONCURRENTLY support (PG 18+)PostgresAlterIndexExpressionwith all 8 ALTER INDEX action typesIndexSupportprotocol method overrides toPostgresIndexMixinformat_drop_index_statementandformat_alter_index_statementto mixinformat_add_index_action/format_drop_index_actionUnsupportedFeatureError stubs in dialectTrigger & Index gap fill (7329e9f):
supports_trigger/supports_create_trigger/supports_drop_triggertoPostgresTriggerMixinsupports_create_index/supports_drop_index/supports_unique_index/supports_index_if_not_exists/supports_index_if_existstoPostgresIndexMixinFalse/UnsupportedFeatureErrorsupports_index_if_not_existsversion gate in dialect.py (PG 9.5+)Table support (1ee5660):
supports_if_not_exists_table(PG 9.5+),supports_if_exists_table,supports_temporary_table,supports_table_partitioning(PG 10+),supports_table_tablespacetoPostgresTableMixinTest coverage (9bff787):
POSTGRES_PROTOCOL_MIXIN_PAIRSType of change
feat: A new featuretest: Adding missing tests or correcting existing testsfix: Bug fixesBreaking Change
Testing
Test Plan:
Ran
pytest tests/rhosocial/activerecord_postgres_test/feature/backend/postgres/ tests/rhosocial/activerecord_postgres_test/feature/backend/test_postgres_protocol_conformance.py- 517 passed.Checklist
changelog.d/<issue_number>.<type>.md).