Skip to content

Commit 48e776b

Browse files
feat(sqlalchemy): document baseline test-suite requirements (ISSUE-46)
Add declarations for cte, window_functions, returning, insert_from_select, on_update_or_delete_cascades, self_referential_foreign_keys, unique/primary/foreign_key/index_reflection, temporary_tables, and table_ddl_if_exists — all mirroring SQLite behavior (exclusions.open()). These don't change effective behavior (SuiteRequirements already returns open for most) but make the dqlite contract explicit. Running the SQLAlchemy compliance suite later can tighten each as needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3769fce commit 48e776b

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

src/sqlalchemydqlite/requirements.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,69 @@ def two_phase_transactions(self) -> Any:
4848
def temp_table_reflection(self) -> Any:
4949
"""SQLite supports temp table reflection."""
5050
return exclusions.open()
51+
52+
# --- Baseline declarations mirroring SQLite behavior ------------
53+
# These don't change the effective default (SuiteRequirements already
54+
# returns exclusions.open() for most), but make the dqlite contract
55+
# explicit so a future maintainer running the SQLAlchemy compliance
56+
# suite has a single source of truth to adjust.
57+
58+
@property
59+
def cte(self) -> Any:
60+
"""Common Table Expressions (WITH)."""
61+
return exclusions.open()
62+
63+
@property
64+
def window_functions(self) -> Any:
65+
"""SQL window functions (OVER / PARTITION BY)."""
66+
return exclusions.open()
67+
68+
@property
69+
def returning(self) -> Any:
70+
"""RETURNING clause on DML."""
71+
return exclusions.open()
72+
73+
@property
74+
def insert_from_select(self) -> Any:
75+
"""INSERT INTO ... SELECT."""
76+
return exclusions.open()
77+
78+
@property
79+
def on_update_or_delete_cascades(self) -> Any:
80+
"""ON UPDATE/DELETE CASCADE foreign-key actions."""
81+
return exclusions.open()
82+
83+
@property
84+
def self_referential_foreign_keys(self) -> Any:
85+
"""Table references itself via foreign key."""
86+
return exclusions.open()
87+
88+
@property
89+
def unique_constraint_reflection(self) -> Any:
90+
"""Inspector reports UNIQUE constraints."""
91+
return exclusions.open()
92+
93+
@property
94+
def primary_key_constraint_reflection(self) -> Any:
95+
"""Inspector reports PRIMARY KEY constraints."""
96+
return exclusions.open()
97+
98+
@property
99+
def foreign_key_constraint_reflection(self) -> Any:
100+
"""Inspector reports FOREIGN KEY constraints."""
101+
return exclusions.open()
102+
103+
@property
104+
def index_reflection(self) -> Any:
105+
"""Inspector reports indexes."""
106+
return exclusions.open()
107+
108+
@property
109+
def temporary_tables(self) -> Any:
110+
"""CREATE TEMPORARY TABLE support (same as SQLite)."""
111+
return exclusions.open()
112+
113+
@property
114+
def table_ddl_if_exists(self) -> Any:
115+
"""CREATE TABLE IF NOT EXISTS / DROP TABLE IF EXISTS."""
116+
return exclusions.open()

0 commit comments

Comments
 (0)