Skip to content

v4.7.1

Choose a tag to compare

@nhumrich nhumrich released this 27 Nov 02:02
· 27 commits to main since this release

Bug Fix

Fix whitespace collapsing breaking -- style SQL comments

The regex r'\s+' collapsed all whitespace including newlines, which broke -- style SQL comments by putting everything on one line. PostgreSQL (and other databases) interpret everything after -- as a comment until end of line, so queries like:

query = t"""
SELECT * FROM users
-- Filter by active status
WHERE active = true
"""

Would silently drop the WHERE clause entirely.

Fix

Changed to r'[ \t]+' to only collapse horizontal whitespace (spaces/tabs) while preserving newlines.