NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #252 most downloaded on PyPI
A non-validating SQL parser.
Last release 1 months ago
13 Aug 2026
Ships fairly regularly
a new release about every 7 months
Nearly every release is documented
notes for 39 of 39 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
39 releases · first in 2012
…dollar-quoted literals or multiline comments (CVE-2026-59893). See the security advisory for details: https://github.com/andialbrecht/sqlparse/securit…
Notable Changes
format(sql, reindent=True), which consumed CPU quadratically on long
lists of tuples. See the security advisory for details:
https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-cfqr-cjx5-5jcmpython and php output
formats. Without escaping, SQL containing a backslash could break out of
the generated string literal (CVE-2026-59894). See the security advisory
for details:
https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-3496-9g83-7v6x
The vulnerability was discovered by @7thParkk. Thanks for reporting!Enhancements
END FOR and END CASE are now recognized as keywords.Bug Fixes
CREATE TABLE ... AS SELECT
statements when the as keyword is lowercase (pr867 by Osamaali313).ROW_FORMAT as a keyword so that ALTER TABLE ... ROW_FORMAT=...
no longer merges the table name and the option into a single identifier
(issue773, pr860 by apoorvdarshan).MATERIALIZED as a keyword so it is parsed and formatted
consistently in CREATE MATERIALIZED VIEW statements (issue752, pr854 by
gaoflow).get_real_name for names with more than two dotted parts (issue332,
pr865 by chuenchen309).BETWEEN from being reclassified as an identifier
when it is followed by a float literal written without a leading zero, so
that x BETWEEN .03 AND .06 parses its bounds as numbers (issue601, pr868
by deepakganesh78).TokenList.token_not_matching.Other
pixi to uv.flake8 with ruff for code checking and linting.One column per quarter.
Fix DoS protection to raise SQLParseError instead of silently returning None when grouping limits are exceeded (issue827).
Bug Fixes
Add type annotations to top-level API functions and include py.typed marker for PEP 561 compliance, enabling type checking with mypy and other tools (
Enhancements
--in-place flag for in-place editing (issue537).ATTACH and DETACH to PostgreSQL keywords (pr808).INTERSECT to close keywords in WHERE clause (pr820).REGEXP BINARY comparison operator (pr817).Bug Fixes
This version introduces a more generalized handling of potential denial of service attack (DOS) due to recursion errors for deeply nested statements.
Bug Fixes
EXTENSION is now recognized as a keyword (issue785).
Bug Fixes
New "compact" option for formatter. If set, the formatter tries to produce a more compact output by avoiding some line breaks (issue783).
Enhancements
Bug Fixes
strip_whitespace=True where you
previously used just strip_comments=True. strip_comments did some of the
work that strip_whitespace should do.See the security advisory for details: https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-2m57-hf25-phgg The vulnerability was discover…
Notable Changes
Enhancements
Bug Fixes
Other
IMPORTANT: This release fixes a security vulnerability in the parser where a regular expression vulnerable to ReDOS (Regular Expression Denial of Serv…
Notable Changes
Bug Fixes
Other
Add support for DIV operator (pr664, by chezou).
Enhancements
Bug Fixes
Other
IMPORTANT: This release fixes a security vulnerability in the strip comments filter. In this filter a regular expression that was vulnerable to ReDOS…
Notable Changes
Enhancements
Bug Fixes
Just removed a debug print statement, sorry...
Bug Fixes
Remove support for end-of-life Python 2.7 and 3.4. Python 3.5+ is now required.
Notable Changes
Enhancements
Bug Fixes
Add HQL keywords (pr475, by matwalk).
Enhancements
Bug Fixes
New formatting option "--indent_after_first" (pr345, by johshoff).
Notable Changes
Enhancements
Bug Fixes
Internal Changes
Add more keywords for MySQL table options (pr328, pr333, by phdru).
Enhancements
Bug Fixes
New command line option "--encoding" (by twang2218, pr317).
Enhancements
Bug Fixes
Internal Changes
Add comma_first option: When splitting list "comma first" notation is used (issue141).
Enhancements
Bug Fixes
Internal Changes
is_whitespace and is_group changed into propertiesPostgreSQL: Function bodys are parsed as literal string. Previously sqlparse assumed that all function bodys are parsable psql strings (see issue277).
Notable Changes
Bug Fixes
IMPORTANT: The supported Python versions have changed with this release. sqlparse 0.2.x supports Python 2.7 and Python >= 3.3.
IMPORTANT: The supported Python versions have changed with this release. sqlparse 0.2.x supports Python 2.7 and Python >= 3.3.
Thanks to the many contributors for writing bug reports and working on pull requests who made this version possible!
Internal Changes
Enhancements
Bug Fixes
Fix IndexError when statement contains WITH clauses (issue205).
Bug Fixes
Remove universal wheel support, added in 0.1.17 by mistake.
Bug Fixes
Speed up parsing of large SQL statements (pull request: issue201, fixes the following issues: issue199, issue135, issue62, issue41, by Ryan Wooden).
Enhancements
Bug Fixes
Misc
Fix a regression in get_alias() introduced in 0.1.15 (issue185).
Bug Fixes
Fix a regression for identifiers with square bracktes notation (issue153, by darikg).
Bug Fixes
Enhancements
Floats in UPDATE statements are now handled correctly (issue145).
Bug Fixes
Enhancements
Fix a regression in handling of NULL keywords introduced in 0.1.12.
Bug Fixes
Fix handling of NULL keywords in aliased identifiers.
Bug Fixes
Enhancements
Fix incorrect parsing of string literals containing line breaks (issue118).
Bug Fixes
Enhancements
Other
Removed buffered reading again, it obviously causes wrong parsing in some rare cases (issue114).
Bug Fixes
Enhancements
Fix an regression introduced in 0.1.5 where sqlparse didn't properly distinguished between single and double quoted strings when tagging identifier (i
Bug Fixes
Enhancements
Whitespaces within certain keywords are now allowed (issue97, patch proposed by xcombelle).
Bug Fixes
Enhancements
Fix Python 3 compatibility of sqlformat script (by Pi Delport).
Bug Fixes
Enhancements
Other
sqlparse is now compatible with Python 3 without any patches. The Python 3 version is generated during install by 2to3. You'll need distribute to inst
sqlparse is now compatible with Python 3 without any patches. The Python 3 version is generated during install by 2to3. You'll need distribute to install sqlparse for Python 3.
Bug Fixes
Other
Deprecate sqlparse.SQLParseError. Please use sqlparse.exceptions.SQLParseError instead.
Bug Fixes
Other
Avoid "stair case" effects when identifiers, functions, placeholders or keywords are mixed in identifier lists (issue45, issue49, issue52) and when as
Bug Fixes
Improve parsing of floats (thanks to Kris).
Bug Fixes
Other
Fixed incorrect detection of keyword fragments embed in names (issue7, reported and initial patch by andyboyko).
Bug Fixes
Lexers preserves original line breaks (issue1).
Bug Fixes
Other
Initial release.
Initial release.
Initial release.
On this page
Changes in python-sqlparse
Changelog
Development Version
Release 0.6.0 (Aug 13, 2026)
Release 0.5.5 (Dec 19, 2025)
Release 0.5.4 (Nov 28, 2025)
Release 0.5.3 (Dez 10, 2024)
Release 0.5.2 (Nov 14, 2024)
Release 0.5.1 (Jul 15, 2024)
Release 0.5.0 (Apr 13, 2024)
Release 0.4.4 (Apr 18, 2023)
Release 0.4.3 (Sep 23, 2022)
Release 0.4.2 (Sep 10, 2021)
Release 0.4.1 (Oct 08, 2020)
Release 0.4.0 (Oct 07, 2020)
Release 0.3.1 (Feb 29, 2020)
Release 0.3.0 (Mar 11, 2019)
Release 0.2.4 (Sep 27, 2017)
Release 0.2.3 (Mar 02, 2017)
Release 0.2.2 (Oct 22, 2016)
Release 0.2.1 (Aug 13, 2016)
Release 0.2.0 (Jul 20, 2016)
Release 0.1.19 (Mar 07, 2016)
Release 0.1.18 (Oct 25, 2015)
Release 0.1.17 (Oct 24, 2015)
Release 0.1.16 (Jul 26, 2015)
Release 0.1.15 (Apr 15, 2015)
Release 0.1.14 (Nov 30, 2014)
Release 0.1.13 (Oct 09, 2014)
Release 0.1.12 (Sep 20, 2014)
Release 0.1.11 (Feb 07, 2014)
Release 0.1.10 (Nov 02, 2013)
Release 0.1.9 (Sep 28, 2013)
Release 0.1.8 (Jun 29, 2013)
Release 0.1.7 (Apr 06, 2013)
Release 0.1.6 (Jan 01, 2013)
Release 0.1.5 (Nov 13, 2012)
Release 0.1.4 (Apr 20, 2012)
Release 0.1.3 (Jul 29, 2011)
Release 0.1.2 (Nov 23, 2010)
Release 0.1.1 (May 6, 2009)
Release 0.1.0 (Apr 8, 2009)
Your coding agent can read these notes before it upgrades. Set up the MCP server →