Skip to content

Commit 9f117b5

Browse files
committed
feat: split returning support into DML-specific flags for PostgreSQL dialect
1 parent f931ed2 commit 9f117b5

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ jobs:
7777
pip install -r requirements.txt
7878
pip install -r requirements-dev.txt
7979
80-
- name: Install activerecord and testsuite from PyPI
80+
- name: Install activerecord and testsuite
8181
run: |
82-
pip install rhosocial-activerecord==1.0.0.dev26
82+
pip install git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev27
8383
pip install rhosocial-activerecord-testsuite==1.0.0.dev13
8484
8585
- name: Create postgres scenario config

‎src/rhosocial/activerecord/backend/impl/postgres/dialect.py‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,17 @@ def supports_materialized_cte(self) -> bool:
472472
"""MATERIALIZED hint is supported since PostgreSQL 12."""
473473
return self.version >= (12, 0, 0)
474474

475-
def supports_returning_clause(self) -> bool:
476-
"""RETURNING clause is supported since PostgreSQL 8.2."""
477-
return True # Supported in all modern versions
475+
def supports_returning_insert(self) -> bool:
476+
"""RETURNING clause is supported for INSERT since PostgreSQL 8.2."""
477+
return self.version >= (8, 2, 0)
478+
479+
def supports_returning_update(self) -> bool:
480+
"""RETURNING clause is supported for UPDATE since PostgreSQL 8.2."""
481+
return self.version >= (8, 2, 0)
482+
483+
def supports_returning_delete(self) -> bool:
484+
"""RETURNING clause is supported for DELETE since PostgreSQL 8.2."""
485+
return self.version >= (8, 2, 0)
478486

479487
def supports_window_functions(self) -> bool:
480488
"""Window functions are supported since PostgreSQL 8.4."""

0 commit comments

Comments
 (0)