Repository navigation
feat(backend): add PostgreSQL DDL coverage-completion expressions and CREATE UNLOGGED TABLE - #53
Merged
vistart merged 5 commits intoAug 8, 2026
Conversation
Add expression/mixin/protocol triads covering the remaining PostgreSQL DDL coverage gaps, each version-gated and exposed through a @runtime_checkable Protocol: - RLS table configuration (ENABLE/DISABLE/ALWAYS/FORCE) — PG 9.5+ - ALTER TABLE SET LOGGED/UNLOGGED (9.6+) and SET ACCESS METHOD (15+) - CLUSTER (index re-cluster) — 9.6+ - CREATE/ALTER/DROP DOMAIN (9.6+; ALTER supports SET DEFAULT/RENAME NOT NULL) - CREATE/DROP COLLATION objects (9.6+) - CREATE/DROP FOREIGN TABLE (9.6+) - CREATE/DROP FUNCTION and CREATE/DROP AGGREGATE (9.6+) - CREATE/DROP PUBLICATION / SUBSCRIPTION (10+) PostgresAlterColumnModifierMixin.format_alter_column_action now renders the ALTER COLUMN ... SET DATA TYPE ... USING (expr) conversion (opt-in via dialect_options['using']), raising ValueError when used on non-type ops. PostgreSQL extensions only — core rhosocial-activerecord untouched. Adds pure-SQL unit tests (no DB) for capability switches, protocol conformance, and SQL generation. Closes the plan at .claude/plan/2026-08-07 postgres-coverage-gap-analysis.md.
…TABLE
Plan 4.6/4.7 closure:
- CREATE UNLOGGED TABLE via dialect_options={'unlogged_table': True} on
CreateTableExpression, version-gated at 9.5+, rendering through
PostgresTableMixin.format_create_table_statement; TEMPORARY wins over
UNLOGGED. Exposes supports_unlogged_table on PostgresTableSupport.
- RENAME COLUMN / RENAME TABLE verified through core actions and covered
by tests (already supported by core DDL; no new mixin needed).
Tests:
- Extend test_alter_table_if_exists.py with ALTER COLUMN SET DATA TYPE
[USING] and RENAME subclause coverage plus CREATE UNLOGGED TABLE.
- Add plan §6.3 version-baseline sweep at PG 9.6/10/11/14/15/17/19 with
UnsupportedFeatureError gates.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release/v1.0.0.dev16 #53 +/- ##
========================================================
+ Coverage 73.58% 74.68% +1.09%
========================================================
Files 281 305 +24
Lines 11590 12377 +787
Branches 1879 2001 +122
========================================================
+ Hits 8529 9244 +715
- Misses 2456 2500 +44
- Partials 605 633 +28
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:
|
…de paths Static-check pass over source and tests touched by the DDL coverage work: - src: drop unused imports (types, ddl/__init__, named_expressions/partition), fix E501 in examples, restore noqa where intentional - tests: remove unused imports, add E402 noqa to late imports, drop unused backend binding var No behavioral change.; src and changed tests pass ruff.
|
8 of 12 tasks
vistart
added a commit
that referenced
this pull request
Aug 15, 2026
… CREATE UNLOGGED TABLE (#53) * feat(backend): add coverage-gap DDL expressions for PostgreSQL Add expression/mixin/protocol triads covering the remaining PostgreSQL DDL coverage gaps, each version-gated and exposed through a @runtime_checkable Protocol: - RLS table configuration (ENABLE/DISABLE/ALWAYS/FORCE) — PG 9.5+ - ALTER TABLE SET LOGGED/UNLOGGED (9.6+) and SET ACCESS METHOD (15+) - CLUSTER (index re-cluster) — 9.6+ - CREATE/ALTER/DROP DOMAIN (9.6+; ALTER supports SET DEFAULT/RENAME NOT NULL) - CREATE/DROP COLLATION objects (9.6+) - CREATE/DROP FOREIGN TABLE (9.6+) - CREATE/DROP FUNCTION and CREATE/DROP AGGREGATE (9.6+) - CREATE/DROP PUBLICATION / SUBSCRIPTION (10+) PostgresAlterColumnModifierMixin.format_alter_column_action now renders the ALTER COLUMN ... SET DATA TYPE ... USING (expr) conversion (opt-in via dialect_options['using']), raising ValueError when used on non-type ops. PostgreSQL extensions only — core rhosocial-activerecord untouched. Adds pure-SQL unit tests (no DB) for capability switches, protocol conformance, and SQL generation. Closes the plan at .claude/plan/2026-08-07 postgres-coverage-gap-analysis.md. * docs(backend): add JSONExpression type hints to enhanced JSONB mixin and protocol * feat(backend): complete DDL coverage gaps RENAME and CREATE UNLOGGED TABLE Plan 4.6/4.7 closure: - CREATE UNLOGGED TABLE via dialect_options={'unlogged_table': True} on CreateTableExpression, version-gated at 9.5+, rendering through PostgresTableMixin.format_create_table_statement; TEMPORARY wins over UNLOGGED. Exposes supports_unlogged_table on PostgresTableSupport. - RENAME COLUMN / RENAME TABLE verified through core actions and covered by tests (already supported by core DDL; no new mixin needed). Tests: - Extend test_alter_table_if_exists.py with ALTER COLUMN SET DATA TYPE [USING] and RENAME subclause coverage plus CREATE UNLOGGED TABLE. - Add plan §6.3 version-baseline sweep at PG 9.6/10/11/14/15/17/19 with UnsupportedFeatureError gates. * test(backend): split DDL expression tests and close DDL mixin coverage gaps * chore(backend): clean up unused imports and long-line style in DDL code paths Static-check pass over source and tests touched by the DDL coverage work: - src: drop unused imports (types, ddl/__init__, named_expressions/partition), fix E501 in examples, restore noqa where intentional - tests: remove unused imports, add E402 noqa to late imports, drop unused backend binding var No behavioral change.; src and changed tests pass ruff.
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
Closes the PostgreSQL SQL-command coverage gaps documented in the 2026-08-07 coverage-gap analysis plan
(
.claude/plan/2026-08-07/postgres-coverage-gap-analysis.md). Adds expression/mixin/protocol triads so theremaining PostgreSQL DDL objects and ALTER TABLE subclauses can be driven through the Expression-Dialect
pipeline, each version-gated (PG 9.6–19 baseline) and exposed via
@runtime_checkableprotocols:ENABLE/DISABLE [ALWAYS] ROW LEVEL SECURITYandFORCE/NO FORCE RLS(
PostgresAlterTableRlsExpression,PostgresForceRlsExpression; PG 9.5+)LOGGED/UNLOGGED(9.6+) andSET ACCESS METHOD(15+)CLUSTER table [ USING index ] [ VERBOSE ](9.6+)CREATE/ALTER/DROP DOMAIN(9.6+, ALTER supports SET DEFAULT / RENAME TO)CREATE/DROP COLLATIONobjects (9.6+)CREATE/DROP FOREIGN TABLE(9.6+)CREATE/DROP FUNCTIONandCREATE/DROP AGGREGATE(9.6+)CREATE/DROP PUBLICATION/CREATE/DROP SUBSCRIPTION(10+)SET DATA TYPE ... USING (expr)conversion on the existing coreAlterColumnaction(opt-in via
dialect_options={"using": ...}; rejected on non-type operations)CREATE UNLOGGED TABLEviadialect_options={"unlogged_table": True}(PG 9.5+), withTEMPORARYtaking precedence
All are PostgreSQL vendor extensions implemented only in the postgres backend package; the core
rhosocial-activerecordlibrary is untouched.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 such as documentation generationci: Changes to our CI configuration files and scriptsrevert: Reverts a previous commitBreaking Change
Applicable
rhosocial-activerecordVersion Range: >=1.0.0,<2.0.0Related Repositories/Packages
None — core
rhosocial-activerecordis not modified. This PR is the postgres counterpart to the single-branchplan; sibling coverage-completion work already landed in
python-activerecord(SQLite) andpython-activerecord-mysql.Testing
Test Plan:
test_ddl_expressions.py,test_ddl_protocols.py,test_policy.py,test_alter_table_if_exists.py§6.3version-baseline sweep at PG 9.6/10/11/14/15/17/19Checklist
changelog.d/53.added.md).routed through identifier quoting / parameter placeholders).
Additional Notes
Commit history since
release/v1.0.0.dev16:16a6bc5feat(backend): add coverage-gap DDL expressions for PostgreSQL8ccd35edocs(backend): add JSONExpression type hints to enhanced JSONB mixin and protocol147efd3feat(backend): complete DDL coverage gaps RENAME and CREATE UNLOGGED TABLECI run (workflow_dispatch, head
147efd3): all 12 matrix jobs succeeded.