Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
45b0c83
fix(postgres): drop index by name without ON <table>
vistart Sep 19, 2026
33f1e28
feat(postgres): add PostgresPartitionClause derived from generic clause
vistart Sep 20, 2026
9b58331
feat(postgres): add PostgresColumnDefinition and typed column options
vistart Sep 20, 2026
0a1e635
feat(postgres): add PostgresCreateTableOptions and render UNLOGGED
vistart Sep 20, 2026
0a530c6
test(postgres): use PostgresCreateTableOptions for unlogged tests
vistart Sep 20, 2026
a32f3d1
refactor(postgres): derive typed index expressions, drop index dialec…
vistart Sep 20, 2026
fafbaf3
refactor(postgres): typed ALTER using, EXCLUDE constraint, vector index
vistart Sep 20, 2026
173cc55
refactor(postgres): drop dead dialect_options pass-through
vistart Sep 20, 2026
ce29c9d
refactor(postgres): drop reserved dialect_options bag from DDL expres…
vistart Sep 20, 2026
a0fac01
refactor(postgres): drop reserved dialect_options from ILIKE expression
vistart Sep 20, 2026
f5b43bc
refactor(postgres): drop dialect_options from data-type value objects
vistart Sep 20, 2026
a7fa502
test(postgres): pin generated-column capability bits
vistart Sep 20, 2026
c4c330f
fix(postgres): wire PostgresDatabaseMixin into the dialect
vistart Sep 20, 2026
fea7b78
docs(postgres): update examples to typed options / IdentityClause
vistart Sep 20, 2026
e68f4ae
refactor(ddl): drop legacy identity fields from column classes
vistart Sep 21, 2026
a9d2dda
feat(ddl): render column attributes; backend identity syntax
vistart Sep 21, 2026
c202d93
test(ddl): classify ColumnAttributeSupport; use deriver.creation_plan()
vistart Sep 21, 2026
b657035
feat(postgres): declare supports_table_inherits
vistart Sep 21, 2026
53bd651
fix(postgres): drop duplicate supports_table_inherits
vistart Sep 21, 2026
43e6763
test(postgres): live Model.truncate() execution (sync + async)
vistart Sep 22, 2026
445e647
fix(postgres): remove invalid inline column COMMENT; declare supports…
vistart Sep 23, 2026
fef8bc3
refactor(ddl): use core typed comment clause nodes
vistart Sep 23, 2026
8a75884
test(ddl): classify CommentSupport for PostgreSQL conformance
vistart Sep 23, 2026
ba93b90
test: drop redundant __primary_key__ = "id" from fixtures
vistart Sep 23, 2026
19af5e5
feat(postgres): complete type and domain DDL support
vistart Sep 24, 2026
8902cb0
test(ddl): cover table inheritance and tablespace
vistart Sep 24, 2026
ae04f19
fix(postgres): restore dialect base initialization
vistart Sep 24, 2026
47111bd
fix(postgres): align derived DDL contracts
vistart Sep 24, 2026
7c59cf2
feat(postgres): add partition lifecycle provider
vistart Sep 25, 2026
1410721
fix(postgres): remove unrelated COPY and REPACK imports
vistart Sep 25, 2026
c7019b3
feat(postgres): complete DDL and PG19 expression support
vistart Sep 25, 2026
debe75b
refactor(postgres): remove generated DDL lifecycle
vistart Sep 25, 2026
d32196e
fix(protocol): declare partition support capabilities
vistart Sep 25, 2026
4e4abc5
test(ddl): cover DDLSource collection
vistart Sep 25, 2026
56ee162
fix(postgres): restore MV storage_options and complete MV DDL coverage
vistart Sep 25, 2026
1bef1e6
test(postgres): align materialized view tests with corrected contracts
vistart Sep 25, 2026
72f1c46
docs(postgres): record why SQL/PGQ stays disabled after 19 Beta 4
vistart Sep 26, 2026
d0040c1
fix(backend): repair unresolvable TYPE_CHECKING imports
vistart Sep 27, 2026
9f4ff33
chore(test): register the pytest markers the suite already uses
vistart Sep 27, 2026
cc825f6
fix(scripts): stop the pre-commit hook from blocking commits on older…
vistart Sep 27, 2026
4e9d1f4
ci: install core and testsuite from release branches
vistart Sep 27, 2026
f7dbc39
chore: add changelog fragment for PR #58
vistart Sep 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ dependencies = [
```python
extras_require = {
"mysql": ["mysql-connector-python>=8.0.0"], # MySQL backend
"postgresql": ["psycopg2>=2.9.0"], # PostgreSQL backend
"postgresql": ["psycopg[binary]>=3.2.13"], # PostgreSQL backend
"dev": ["pytest", "black", "mypy"], # Development tools
}
```
Expand All @@ -623,7 +623,7 @@ def discover_backends():

try:
from rhosocial.activerecord.backend.impl.postgresql import PostgreSQLBackend
backends['postgresql'] = PostgreSQLBackend # Uses psycopg2 directly
backends['postgresql'] = PostgreSQLBackend # Uses psycopg 3 directly
except ImportError:
pass

Expand Down
2 changes: 1 addition & 1 deletion .claude/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This backend CANNOT be used with free-threaded Python builds. Free-threaded test

```toml
dependencies = [
"psycopg[binary]",
"psycopg[binary]>=3.2.13",
"rhosocial-activerecord"
]
```
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
- name: Install activerecord and testsuite
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/activerecord-derived-ddl"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17"

- name: Create postgres scenario config
run: |
Expand Down Expand Up @@ -280,7 +280,7 @@ jobs:
- name: Install activerecord and testsuite
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/activerecord-derived-ddl"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17"

- name: Create postgres scenario config
run: |
Expand Down Expand Up @@ -392,7 +392,7 @@ jobs:
- name: Install activerecord and testsuite
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/activerecord-derived-ddl"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17"

- name: Create postgres scenario config
run: |
Expand Down Expand Up @@ -455,13 +455,12 @@ jobs:
fail_ci_if_error: false

test-postgres-19:
name: Python 3.14 / postgres 19beta3 (PGQ)
name: Python 3.14 / postgres 19beta4
runs-on: ubuntu-latest
continue-on-error: true

services:
postgres:
image: postgres:19beta3
image: postgres:19beta4
env:
POSTGRES_DB: test_db
POSTGRES_USER: root
Expand Down Expand Up @@ -491,7 +490,7 @@ jobs:
- name: Install activerecord and testsuite
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/activerecord-derived-ddl"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17"

- name: Create postgres scenario config
run: |
Expand Down
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## [v1.0.0.dev17] - 2026-09-25

### Changed

- Updated PostgreSQL 19 SQL/PGQ status: PostgreSQL 19 Beta 4 withdrew SQL/PGQ, and graph capabilities are now fail-closed by default with explicit opt-in overrides.

### Fixed

- Corrected PostgreSQL partition documentation: `ATTACH PARTITION CONCURRENTLY` is unsupported; concurrent `DETACH PARTITION` with `FINALIZE` is supported on PostgreSQL 14+.


## [v1.0.0.dev16] - 2026-08-15

### Added
Expand All @@ -17,8 +28,8 @@
- Added PostgreSQL expression-level `COLLATE` support with schema-qualified collation validation. ([#40](https://github.com/rhosocial/python-activerecord-postgres/issues/40))
- Added PostgreSQL support for core SQL/XML standard expressions, including XML construction, serialization, aggregation, and query/table expression capability declarations. ([#41](https://github.com/rhosocial/python-activerecord-postgres/issues/41))
- Added PostgreSQL dialect support for datetime interval expressions (`EXTRACT`, `DATE_PART`, `DATE_TRUNC`, `INTERVAL` add/subtract, date diff) with EXPLAIN-backed index usage verification tests. ([#42](https://github.com/rhosocial/python-activerecord-postgres/issues/42))
- Added comprehensive PostgreSQL partitioning support including ATTACH CONCURRENTLY/DEFAULT partition, partition auto-management via named expressions (monthly/quarterly), pg_partman create_parent parameter completion, enhanced partition metadata queries, and full test coverage ([#43](https://github.com/rhosocial/python-activerecord-postgres/issues/43))
- Add SQL/PGQ property graph query support and PostgreSQL 19 compatibility enhancements ([#44](https://github.com/rhosocial/python-activerecord-postgres/issues/44))
- Added comprehensive PostgreSQL partitioning support including standard ATTACH PARTITION, concurrent DETACH PARTITION with FINALIZE (PG 14+), DEFAULT partition, partition auto-management via named expressions (monthly/quarterly), pg_partman create_parent parameter completion, enhanced partition metadata queries, and full test coverage ([#43](https://github.com/rhosocial/python-activerecord-postgres/issues/43))
- Added capability-gated SQL/PGQ property graph query expressions and PostgreSQL 19 compatibility gates ([#44](https://github.com/rhosocial/python-activerecord-postgres/issues/44))



Expand Down
8 changes: 7 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@ This project is under active development. Key features implemented:

## Version Control and Changelog

This project adheres to the same version control, branching, commit message, and changelog management standards as the main `python-activerecord` project.
This project adheres to the same version control, branching, commit message, and changelog management standards as the main `python-activerecord` project.

## Search Scope

- Use `rg` for repository searches; never use `grep`.
- Limit searches to this `python-activerecord` repository and its related testsuite/backend directories.
- Exclude `.git/`, `.venv*/`, `__pycache__/`, `build/`, `dist/`, and other cache directories.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ print(user.id) # Populated automatically via RETURNING

- **Python**: 3.8+ (including 3.13t/3.14t free-threaded builds)
- **Core**: `rhosocial-activerecord>=1.0.0`
- **Driver**: `psycopg>=3.2.12`
- **Driver**: `psycopg[binary]>=3.2.13`

## PostgreSQL Version Compatibility

Expand Down
1 change: 1 addition & 0 deletions changelog.d/58.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add PostgreSQL materialized view coverage: `PostgresCreateMaterializedViewExpression` (schema qualification, `IF NOT EXISTS`), `PostgresDropMaterializedViewExpression` (schema qualification), `PostgresAlterMaterializedViewExpression` with RENAME TO / SET SCHEMA / SET / RESET / OWNER TO actions, the enumerated `PostgresStorageParameter` reloption set with enum-based validation, and `list_materialized_views()` / `get_materialized_view_info()` / `materialized_view_exists()` introspection reporting `is_populated` and `has_unique_index`.
1 change: 1 addition & 0 deletions changelog.d/58.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace the reserved `dialect_options` bag with typed declarations: `PostgresColumnDefinition` and typed column options, `PostgresCreateTableOptions` with `UNLOGGED`, `PostgresPartitionClause` with a partition lifecycle provider, and typed `ALTER ... USING`, `EXCLUDE` constraints and vector indexes. Correct capability reporting for `supports_table_inherits`, `supports_comment_on` and `CommentSupport`, wire `PostgresDatabaseMixin` into the dialect, and fix index-drop rendering for a bare index name without `ON <table>`.
1 change: 1 addition & 0 deletions changelog.d/58.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed materialized view support in the PostgreSQL dialect: `PostgresMaterializedViewMixin` was listed after the core `ViewMixin` in `PostgresDialect`, so its CREATE formatter was dead code and `storage_options` was silently dropped from the generated SQL. Storage parameters are also emitted in the correct PostgreSQL grammar order (`WITH (...)` before `TABLESPACE`), and `REFRESH MATERIALIZED VIEW CONCURRENTLY` is now version-gated (PostgreSQL 9.4+) on both the generic and the PostgreSQL expression, raising `UnsupportedFeatureError` instead of `ValueError`.
1 change: 1 addition & 0 deletions changelog.d/58.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Install core and testsuite from release branches in CI instead of the derived-DDL feature branch, repair TYPE_CHECKING imports broken by the expression namespace split, register the pytest markers the suite already uses, and stop the pre-commit hook from blocking commits on revisions that predate `scripts/preflight.sh`.
1 change: 1 addition & 0 deletions changelog.d/58.removed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove the reserved `dialect_options` bag from data-type value objects, the `ILIKE` expression, DDL expressions and index expressions, the legacy identity fields on column classes, and the generated DDL lifecycle.
10 changes: 7 additions & 3 deletions docs/en_US/ddl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ The PostgreSQL backend supports the same type-safe DDL expressions as the core l
| `AlterTableExpression` | ✅ Full | ADD/DROP COLUMN, ALTER COLUMN |
| `CreateIndexExpression` | ✅ Full | Index types (BTREE, HASH, GIN, GiST, BRIN) |
| `DropIndexExpression` | ✅ Full | |
| `CreateViewExpression` | ✅ Full | Materialized views support |
| `CreateViewExpression` | ✅ Full | |
| `DropViewExpression` | ✅ Full | |
| `PostgresCreateMaterializedViewExpression` | ✅ Full | IF NOT EXISTS, TABLESPACE, storage parameters (see [materialized views](./materialized_view.md)) |
| `PostgresRefreshMaterializedViewExpression` | ✅ Full | CONCURRENTLY (PG 9.4+, requires a UNIQUE index) |
| `PostgresAlterMaterializedViewExpression` | ✅ Full | RENAME TO, SET SCHEMA, SET/RESET storage parameters, OWNER TO |
| `PostgresDropMaterializedViewExpression` | ✅ Full | IF EXISTS, CASCADE |
| `CreatePartitionExpression` | ✅ Full | RANGE, LIST, HASH partitioning (PG 10+) |
| `AttachPartitionExpression` | ✅ Full | Includes CONCURRENTLY (PG 14+) |
| `DetachPartitionExpression` | ✅ Full | Includes CONCURRENTLY (PG 14+) |
| `AttachPartitionExpression` | ✅ Full | Standard ATTACH PARTITION; `CONCURRENTLY` is unsupported |
| `DetachPartitionExpression` | ✅ Full | Includes `CONCURRENTLY` and `FINALIZE` (PG 14+) |
| `AlterIndexExpression` | ✅ Full | RENAME TO, SET TABLESPACE, SET/RESET storage params |
| `ReindexExpression` | ✅ Full | INDEX/TABLE/SCHEMA/DATABASE level, with CONCURRENTLY |

Expand Down
Loading
Loading