Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,9 @@ git checkout as a development dependency.
`python-activerecord-mysql`, etc.) and their `tests/` mirror trees.
3. For provider interface contracts, browse
`src/rhosocial/activerecord/testsuite/feature/<topic>/interfaces.py`.

## 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.
1 change: 1 addition & 0 deletions changelog.d/21.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add cross-backend DDL contracts — a materialized-view contract requiring a dialect that advertises `supports_materialized_view()` to own its CREATE and refresh formatters, and a `DDLSource` collection contract covering retained sources — plus a `requires_cte_order_by` decorator and BMP-only Unicode round-trip tests.
1 change: 1 addition & 0 deletions changelog.d/21.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Narrow the materialized-view contract to semantics every MV backend shares, stop treating MV refresh as a SQL-standard statement, and grade contract skips by whether the dialect can resolve a version. Adapt the expression tests to node-based casts and normalise timezone-aware datetimes.
1 change: 1 addition & 0 deletions changelog.d/21.removed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove the deprecated `features.py` and the unused `sqlite_features.py`.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ class TestDdlAddColumn:
@requires_protocol(AlterTableModifierSupport, "supports_add_column_if_not_exists")
def test_add_column_if_not_exists(self, ddl_dialect):
"""ALTER TABLE ADD COLUMN IF NOT EXISTS should render the IF NOT EXISTS qualifier."""
action = AddColumn(ddl_dialect, ColumnDefinition("content", TextType()), if_not_exists=True)
action = AddColumn(ddl_dialect, ColumnDefinition(ddl_dialect, "content", TextType(ddl_dialect)), if_not_exists=True)
sql, params = action.to_sql()
assert "IF NOT EXISTS" in sql, \
"Expected the rendered SQL to contain the IF NOT EXISTS qualifier"
assert not params, "Expected no bound parameters for ALTER TABLE ADD COLUMN"

def test_add_column_plain_form(self, ddl_dialect):
"""ALTER TABLE ADD COLUMN without if_not_exists should omit the qualifier."""
action = AddColumn(ddl_dialect, ColumnDefinition("content", TextType()))
action = AddColumn(ddl_dialect, ColumnDefinition(ddl_dialect, "content", TextType(ddl_dialect)))
sql, params = action.to_sql()
assert "IF NOT EXISTS" not in sql, \
"Expected the rendered SQL to omit the IF NOT EXISTS qualifier"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TestAsyncDdlAddColumn:
async def test_add_column_if_not_exists(self, async_ddl_dialect):
"""ALTER TABLE ADD COLUMN IF NOT EXISTS should render the IF NOT EXISTS qualifier."""
action = AddColumn(
async_ddl_dialect, ColumnDefinition("content", TextType()), if_not_exists=True
async_ddl_dialect, ColumnDefinition(async_ddl_dialect, "content", TextType(async_ddl_dialect)), if_not_exists=True
)
sql, params = action.to_sql()
assert "IF NOT EXISTS" in sql, \
Expand All @@ -43,7 +43,7 @@ async def test_add_column_if_not_exists(self, async_ddl_dialect):

async def test_add_column_plain_form(self, async_ddl_dialect):
"""ALTER TABLE ADD COLUMN without if_not_exists should omit the qualifier."""
action = AddColumn(async_ddl_dialect, ColumnDefinition("content", TextType()))
action = AddColumn(async_ddl_dialect, ColumnDefinition(async_ddl_dialect, "content", TextType(async_ddl_dialect)))
sql, params = action.to_sql()
assert "IF NOT EXISTS" not in sql, \
"Expected the rendered SQL to omit the IF NOT EXISTS qualifier"
Expand Down
Loading
Loading