]> 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:54:44 +0000 (09:54 -0400)
commit189907be93392246ed5948506f1ca3921b8379f0
tree099f43d3970b962c674f777e412948808041741b
parente1f3b43ad8b45afca3a7a363a41103f5f468f461
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
doc/build/changelog/unreleased_20/12924.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/sqlite/base.py
test/dialect/sqlite/test_reflection.py