]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
improve sqlite reflection regex for unusual names/formats
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 18 Oct 2025 20:43:22 +0000 (16:43 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 24 Oct 2025 13:56:11 +0000 (09:56 -0400)
commit25eaf315bdee5afa7a2e834d1ac8295362b482e6
tree7a1333e560f7006b7672de4e229e3fde96ab81c2
parente1dd2daf125320117bb33dc67b377272c8c916b8
improve sqlite reflection regex for unusual names/formats

A series of improvements have been made for reflection of CHECK constraints
on SQLite. The reflection logic now correctly handles table names
containing the strings "CHECK" or "CONSTRAINT", properly supports all four
SQLite identifier quoting styles (double quotes, single quotes, brackets,
and backticks) for constraint names, and accurately parses CHECK constraint
expressions containing parentheses within string literals using balanced
parenthesis matching with string context tracking.    Big thanks to
GruzdevAV for new test cases and implementation ideas.

Fixes: #12924
Change-Id: I0390ac334c98e934c7e0353f47c9f43204791af5
(cherry picked from commit 189907be93392246ed5948506f1ca3921b8379f0)
doc/build/changelog/unreleased_20/12924.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/sqlite/base.py
test/dialect/sqlite/test_reflection.py