NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #4022 most downloaded on PyPI
sqlfmt formats your dbt SQL files so you don't have to.
Last release 1 months ago
10 Aug 2026
Ships fairly regularly
a new release about every 3 months
Nearly every release is documented
notes for 59 of 59 stable releases
1 version withdrawn
withdrawn after publishing
5 years old
62 releases · first in 2021
One column per quarter.
All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
{% materialization ... %} and {% call statement(...) %} blocks (#309).{% endmacro %}, {% endtest %}, {% endcall %}, or {% endmaterialization %} tag.create warehouse and alter warehouse statements (#312, #299).alter function and drop function statements (#310, #311), and Snowflake's create external function statements (#322).1.5e-9) and the unary + or - operators (e.g., +3), and is now smarter about when the - symbol is the unary negative or binary subtraction operator. (#321 - thank you @liaopeiyuan!).return(return_())).delete statements and the associated keywords using and returning (#281).grant and revoke statements and all associated keywords (#283).create function statements and all associated keywords (#282).explain keyword (#280).table<a int64, b bytes(5), c string>.$foo as ordinary identifiers.tomli dependency.create, insert, grant, etc.) will no longer be formatted (#243).
These statements were never supported by sqlfmt, and the existing algorithm produced bad formatting. Support for DDL and DML statements will be gradually added back in in future versions.
For more information, see the tracking issue for DDL support.array<float64>[1, 2] are now supported, and spaces will no longer be inserted around < and > (#212).tablesample, cluster by, distribute by, sort by, and lateral view are now supported by the polyglot dialect (#264).pivot and unpivot are now supported as word operators, and will have a space between the keyword and the following parentheses.values is now supported as an unterminated keyword; tuples of values will be indented from the values keyword if they span more than one line (#263).SQLFMT and are the SHOUTING_CASE spelling of the options. For example, sqlfmt . --line-length 100 is equivalent to SQLFMT_LINE_LENGTH=100 sqlfmt . (#251).files argument of api.run is now a Collection[pathlib.Path] that represents an exact collection of files to be formatted, instead of a list of paths to search for files. Use api.get_matching_paths(paths, mode) to return the set of exact paths expected by api.run.--no-progressbar option.api.run now accepts an optional callback argument, which must be a Callable[[Awaitable[SqlFormatResult]], None]. Unless the --single-process option is used, the callback is executed after each file is formatted.python -m sqlfmt.between ... and ..., especially in situations where the source includes a line break (#207).%s and %(name)s (#198 - thank you @snorkysnark!).using is now treated as a word operator. It gets a space before its brackets and merging with surrounding lines is now much improved (#218 - thank you @nfcampos!).within group and filter are now treated like over, and the formatting of those aggregate clauses is improved (#205).--dialect clickhouse option, sqlfmt will not lowercase names that could be case-sensitive in ClickHouse, like function names, aliases, etc. (#193 - thank you @Shlomixg!).offset() function and its brackets.union) are now formatted differently. They must be on their own line, and will not cause subsequent blocks to be indented (#188 - thank you @Rainymood!).select * except (...) syntax is now explicitly supported, and formatting is improved. Support added for BigQuery and DuckDB star options: except, exclude, replace.(()) or ()[].~, the jinja string concatenation operator (#182){% else %} and {% elif %} statementsfiles as a List[pathlib.Path] instead of a List[str]pyproject.toml file. See README for more information (#90)--exclude option to specify a glob of files to exclude from formatting (#131)$1) and snowflake stages (@my_stage) as identifiersbetween operator's and keyword (#124 - thank you @WestComputing!)pipx install sqlfmt[jinjafmt]). If black is installed, but you do not want to use this feature, you can disable it with the command-line option --no-jinjafmt@>, ||/, ?-| (#105)--single-process, to force single-processing, even when formatting many filesmake profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
delete statements and the associated keywords using and returning (#281)grant and revoke statements and all associated keywords (#283)create function statements and all associated keywords (#282)explain keyword (#280)table<a int64, b bytes(5), c string>$foo as ordinary identifierstomli dependency.create, insert, grant, etc.) will no longer be formatted (#243).
These statements were never supported by sqlfmt, and the existing algorithm produced bad formatting. Support for DDL and DML statements will be gradually added back in in future versions.
For more information, see the tracking issue for DDL support.array<float64>[1, 2] are now supported, and spaces will no longer be inserted around < and > (#212)tablesample, cluster by, distribute by, sort by, and lateral view are now supported by the polyglot dialect (#264)pivot and unpivot are now supported as word operators, and will have a space between the keyword and the following parenthesesvalues is now supported as an unterminated keyword; tuples of values will be indented from the values keyword if they span more than one line (#263)SQLFMT and are the SHOUTING_CASE spelling of the options. For example, sqlfmt . --line-length 100 is equivalent to SQLFMT_LINE_LENGTH=100 sqlfmt . (#251).files argument of api.run is now a Collection[pathlib.Path] that represents an exact collection of files to be formatted, instead of a list of paths to search for files. Use api.get_matching_paths(paths, mode) to return the set of exact paths expected by api.run--no-progressbar optionapi.run now accepts an optional callback argument, which must be a Callable[[Awaitable[SqlFormatResult]], None]. Unless the --single-process option is used, the callback is executed after each file is formatted.python -m sqlfmtbetween ... and ..., especially in situations where the source includes a line break (#207)%s and %(name)s (#198 - thank you @snorkysnark!)using is now treated as a word operator. It gets a space before its brackets and merging with surrounding lines is now much improved (#218 - thank you @nfcampos!)within group and filter are now treated like over, and the formatting of those aggregate clauses is improved (#205)--dialect clickhouse option, sqlfmt will not lowercase names that could be case-sensitive in ClickHouse, like function names, aliases, etc. (#193 - thank you @Shlomixg!)offset() function and its bracketsunion) are now formatted differently. They must be on their own line, and will not cause subsequent blocks to be indented (#188 - thank you @Rainymood!)select * except (...) syntax is now explicitly supported, and formatting is improved. Support added for BigQuery and DuckDB star options: except, exclude, replace(()) or ()[]~, the jinja string concatenation operator (#182){% else %} and {% elif %} statementsfiles as a List[pathlib.Path] instead of a List[str]pyproject.toml file. See README for more information (#90)--exclude option to specify a glob of files to exclude from formatting (#131)$1) and snowflake stages (@my_stage) as identifiersbetween operator's and keyword (#124 - thank you @WestComputing!)pipx install sqlfmt[jinjafmt]). If black is installed, but you do not want to use this feature, you can disable it with the command-line option --no-jinjafmt@>, ||/, ?-| (#105)--single-process, to force single-processing, even when formatting many filesmake profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
create, insert, grant, etc.) will no longer be formatted (#243).
These statements were never supported by sqlfmt, and the existing algorithm produced bad formatting. Support for DDL and DML statements will be gradually added back in in future versions.
For more information, see the tracking issue for DDL support.array<float64>[1, 2] are now supported, and spaces will no longer be inserted around < and > (#212)tablesample, cluster by, distribute by, sort by, and lateral view are now supported by the polyglot dialect (#264)pivot and unpivot are now supported as word operators, and will have a space between the keyword and the following parenthesesvalues is now supported as an unterminated keyword; tuples of values will be indented from the values keyword if they span more than one line (#263)SQLFMT and are the SHOUTING_CASE spelling of the options. For example, sqlfmt . --line-length 100 is equivalent to SQLFMT_LINE_LENGTH=100 sqlfmt . (#251).files argument of api.run is now a Collection[pathlib.Path] that represents an exact collection of files to be formatted, instead of a list of paths to search for files. Use api.get_matching_paths(paths, mode) to return the set of exact paths expected by api.run--no-progressbar optionapi.run now accepts an optional callback argument, which must be a Callable[[Awaitable[SqlFormatResult]], None]. Unless the --single-process option is used, the callback is executed after each file is formatted.python -m sqlfmtbetween ... and ..., especially in situations where the source includes a line break (#207)%s and %(name)s (#198 - thank you @snorkysnark!)using is now treated as a word operator. It gets a space before its brackets and merging with surrounding lines is now much improved (#218 - thank you @nfcampos!)within group and filter are now treated like over, and the formatting of those aggregate clauses is improved (#205)--dialect clickhouse option, sqlfmt will not lowercase names that could be case-sensitive in ClickHouse, like function names, aliases, etc. (#193 - thank you @Shlomixg!)offset() function and its bracketsunion) are now formatted differently. They must be on their own line, and will not cause subsequent blocks to be indented (#188 - thank you @Rainymood!)select * except (...) syntax is now explicitly supported, and formatting is improved. Support added for BigQuery and DuckDB star options: except, exclude, replace(()) or ()[]~, the jinja string concatenation operator (#182){% else %} and {% elif %} statementsfiles as a List[pathlib.Path] instead of a List[str]pyproject.toml file. See README for more information (#90)--exclude option to specify a glob of files to exclude from formatting (#131)$1) and snowflake stages (@my_stage) as identifiersbetween operator's and keyword (#124 - thank you @WestComputing!)pipx install sqlfmt[jinjafmt]). If black is installed, but you do not want to use this feature, you can disable it with the command-line option --no-jinjafmt@>, ||/, ?-| (#105)--single-process, to force single-processing, even when formatting many filesmake profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
SQLFMT and are the SHOUTING_CASE spelling of the options. For example, sqlfmt . --line-length 100 is equivalent to SQLFMT_LINE_LENGTH=100 sqlfmt . (#251).files argument of api.run is now a Collection[pathlib.Path] that represents an exact collection of files to be formatted, instead of a list of paths to search for files. Use api.get_matching_paths(paths, mode) to return the set of exact paths expected by api.run--no-progressbar optionapi.run now accepts an optional callback argument, which must be a Callable[[Awaitable[SqlFormatResult]], None]. Unless the --single-process option is used, the callback is executed after each file is formatted.python -m sqlfmtbetween ... and ..., especially in situations where the source includes a line break (#207)%s and %(name)s (#198 - thank you @snorkysnark!)using is now treated as a word operator. It gets a space before its brackets and merging with surrounding lines is now much improved (#218 - thank you @nfcampos!)within group and filter are now treated like over, and the formatting of those aggregate clauses is improved (#205)--dialect clickhouse option, sqlfmt will not lowercase names that could be case-sensitive in ClickHouse, like function names, aliases, etc. (#193 - thank you @Shlomixg!)offset() function and its bracketsunion) are now formatted differently. They must be on their own line, and will not cause subsequent blocks to be indented (#188 - thank you @Rainymood!)select * except (...) syntax is now explicitly supported, and formatting is improved. Support added for BigQuery and DuckDB star options: except, exclude, replace(()) or ()[]~, the jinja string concatenation operator (#182){% else %} and {% elif %} statementsfiles as a List[pathlib.Path] instead of a List[str]pyproject.toml file. See README for more information (#90)--exclude option to specify a glob of files to exclude from formatting (#131)$1) and snowflake stages (@my_stage) as identifiersbetween operator's and keyword (#124 - thank you @WestComputing!)pipx install sqlfmt[jinjafmt]). If black is installed, but you do not want to use this feature, you can disable it with the command-line option --no-jinjafmt@>, ||/, ?-| (#105)--single-process, to force single-processing, even when formatting many filesmake profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
files argument of api.run is now a Collection[pathlib.Path] that represents an exact collection of files to be formatted, instead of a list of paths to search for files. Use api.get_matching_paths(paths, mode) to return the set of exact paths expected by api.run--no-progressbar optionapi.run now accepts an optional callback argument, which must be a Callable[[Awaitable[SqlFormatResult]], None]. Unless the --single-process option is used, the callback is executed after each file is formatted.python -m sqlfmtbetween ... and ..., especially in situations where the source includes a line break (#207)%s and %(name)s (#198 - thank you @snorkysnark!)using is now treated as a word operator. It gets a space before its brackets and merging with surrounding lines is now much improved (#218 - thank you @nfcampos!)within group and filter are now treated like over, and the formatting of those aggregate clauses is improved (#205)--dialect clickhouse option, sqlfmt will not lowercase names that could be case-sensitive in ClickHouse, like function names, aliases, etc. (#193 - thank you @Shlomixg!)offset() function and its bracketsunion) are now formatted differently. They must be on their own line, and will not cause subsequent blocks to be indented (#188 - thank you @Rainymood!)select * except (...) syntax is now explicitly supported, and formatting is improved. Support added for BigQuery and DuckDB star options: except, exclude, replace(()) or ()[]~, the jinja string concatenation operator (#182){% else %} and {% elif %} statementsfiles as a List[pathlib.Path] instead of a List[str]pyproject.toml file. See README for more information (#90)--exclude option to specify a glob of files to exclude from formatting (#131)$1) and snowflake stages (@my_stage) as identifiersbetween operator's and keyword (#124 - thank you @WestComputing!)pipx install sqlfmt[jinjafmt]). If black is installed, but you do not want to use this feature, you can disable it with the command-line option --no-jinjafmt@>, ||/, ?-| (#105)--single-process, to force single-processing, even when formatting many filesmake profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
%s and %(name)s (#198 - thank you @snorkysnark!)using is now treated as a word operator. It gets a space before its brackets and merging with surrounding lines is now much improved (#218 - thank you @nfcampos!)within group and filter are now treated like over, and the formatting of those aggregate clauses is improved (#205)--dialect clickhouse option, sqlfmt will not lowercase names that could be case-sensitive in ClickHouse, like function names, aliases, etc. (#193 - thank you @Shlomixg!)offset() function and its bracketsunion) are now formatted differently. They must be on their own line, and will not cause subsequent blocks to be indented (#188 - thank you @Rainymood!)select * except (...) syntax is now explicitly supported, and formatting is improved. Support added for BigQuery and DuckDB star options: except, exclude, replace(()) or ()[]~, the jinja string concatenation operator (#182){% else %} and {% elif %} statementsfiles as a List[pathlib.Path] instead of a List[str]pyproject.toml file. See README for more information (#90)--exclude option to specify a glob of files to exclude from formatting (#131)$1) and snowflake stages (@my_stage) as identifiersbetween operator's and keyword (#124 - thank you @WestComputing!)pipx install sqlfmt[jinjafmt]). If black is installed, but you do not want to use this feature, you can disable it with the command-line option --no-jinjafmt@>, ||/, ?-| (#105)--single-process, to force single-processing, even when formatting many filesmake profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
--dialect clickhouse option, sqlfmt will not lowercase names that could be case-sensitive in ClickHouse, like function names, aliases, etc. (#193 - thank you @Shlomixg!)offset() function and its bracketsunion) are now formatted differently. They must be on their own line, and will not cause subsequent blocks to be indented (#188 - thank you @Rainymood!)select * except (...) syntax is now explicitly supported, and formatting is improved. Support added for BigQuery and DuckDB star options: except, exclude, replace(()) or ()[]~, the jinja string concatenation operator (#182){% else %} and {% elif %} statementsfiles as a List[pathlib.Path] instead of a List[str]pyproject.toml file. See README for more information (#90)--exclude option to specify a glob of files to exclude from formatting (#131)$1) and snowflake stages (@my_stage) as identifiersbetween operator's and keyword (#124 - thank you @WestComputing!)pipx install sqlfmt[jinjafmt]). If black is installed, but you do not want to use this feature, you can disable it with the command-line option --no-jinjafmt@>, ||/, ?-| (#105)--single-process, to force single-processing, even when formatting many filesmake profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
~, the jinja string concatenation operator (#182){% else %} and {% elif %} statementsfiles as a List[pathlib.Path] instead of a List[str]pyproject.toml file. See README for more information (#90)--exclude option to specify a glob of files to exclude from formatting (#131)$1) and snowflake stages (@my_stage) as identifiersbetween operator's and keyword (#124 - thank you @WestComputing!)pipx install sqlfmt[jinjafmt]). If black is installed, but you do not want to use this feature, you can disable it with the command-line option --no-jinjafmt@>, ||/, ?-| (#105)--single-process, to force single-processing, even when formatting many filesmake profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
{% else %} and {% elif %} statementsfiles as a List[pathlib.Path] instead of a List[str]pyproject.toml file. See README for more information (#90)--exclude option to specify a glob of files to exclude from formatting (#131)$1) and snowflake stages (@my_stage) as identifiersbetween operator's and keyword (#124 - thank you @WestComputing!)pipx install sqlfmt[jinjafmt]). If black is installed, but you do not want to use this feature, you can disable it with the command-line option --no-jinjafmt@>, ||/, ?-| (#105)--single-process, to force single-processing, even when formatting many filesmake profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
files as a List[pathlib.Path] instead of a List[str]pyproject.toml file. See README for more information (#90)--exclude option to specify a glob of files to exclude from formatting (#131)$1) and snowflake stages (@my_stage) as identifiersbetween operator's and keyword (#124 - thank you @WestComputing!)pipx install sqlfmt[jinjafmt]). If black is installed, but you do not want to use this feature, you can disable it with the command-line option --no-jinjafmt@>, ||/, ?-| (#105)--single-process, to force single-processing, even when formatting many filesmake profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
$1) and snowflake stages (@my_stage) as identifiersbetween operator's and keyword (#124 - thank you @WestComputing!)pipx install sqlfmt[jinjafmt]). If black is installed, but you do not want to use this feature, you can disable it with the command-line option --no-jinjafmt@>, ||/, ?-| (#105)--single-process, to force single-processing, even when formatting many filesmake profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
$1) and snowflake stages (@my_stage) as identifiersbetween operator's and keyword (#124 - thank you @WestComputing!)pipx install sqlfmt[jinjafmt]). If black is installed, but you do not want to use this feature, you can disable it with the command-line option --no-jinjafmt@>, ||/, ?-| (#105)--single-process, to force single-processing, even when formatting many filesmake profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
pipx install sqlfmt[jinjafmt]). If black is installed, but you do not want to use this feature, you can disable it with the command-line option --no-jinjafmt@>, ||/, ?-| (#105)--single-process, to force single-processing, even when formatting many filesmake profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
--single-process, to force single-processing, even when formatting many filesmake profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
--single-process, to force single-processing, even when formatting many filesmake profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
make profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
make profiling- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
- as the files argument--quiet option-- fmt: off and -- fmt: on comments in sql fileswindow and qualify# comment)All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →