]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
revert SQLite CHECK constraint changes and add new tests
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 5 Sep 2024 17:21:17 +0000 (13:21 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 7 Sep 2024 20:55:35 +0000 (16:55 -0400)
commit75ab6b370034e69bc798f9a77751afb200e24f1d
tree372830b714675172c944c22aafd87692c7d46c0c
parent7949426428f1ec19381116e025b95f86417a85fc
revert SQLite CHECK constraint changes and add new tests

The changes made for SQLite CHECK constraint reflection in versions 2.0.33
and 2.0.34 , :ticket:`11832` and :ticket:`11677`, have now been fully
reverted, as users continued to identify existing use cases that stopped
working after this change.   For the moment, because SQLite does not
provide any consistent way of delivering information about CHECK
constraints, SQLAlchemy is limited in what CHECK constraint syntaxes can be
reflected, including that a CHECK constraint must be stated all on a
single, independent line (or inline on a column definition)  without
newlines, tabs in the constraint definition or unusual characters in the
constraint name.  Overall, reflection for SQLite is tailored towards being
able to reflect CREATE TABLE statements that were originally created by
SQLAlchemy DDL constructs.  Long term work on a DDL parser that does not
rely upon regular expressions may eventually improve upon this situation.
A wide range of additional cross-dialect CHECK constraint reflection tests
have been added as it was also a bug that these changes did not trip any
existing tests.

Fixes: #11840
Change-Id: Iaa4f9651d0c3dd5dbb530ccaa6688169eb7f3bb8
doc/build/changelog/unreleased_20/11840.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/sqlite/base.py
lib/sqlalchemy/testing/requirements.py
lib/sqlalchemy/testing/suite/test_reflection.py
test/dialect/test_sqlite.py
test/requirements.py