Prettier SQL
Prettier SQL is a free, self-hosted plugin that adds SQL formatting to Prettier.
What Prettier SQL is
Prettier SQL is a free, self-hosted plugin that adds SQL formatting to Prettier. It formats SQL files using sql-formatter or node-sql-parser, with supported dialects including BigQuery, DB2, Hive, MariaDB, MySQL, PostgreSQL, Snowflake, SQLite, T-SQL, Trino, ClickHouse, and others. Formatting options cover keyword, data type, function, and identifier casing, as well as indentation and logical-operator line breaks. With prettier-plugin-embed, the plugin can format SQL inside tagged template literals in JavaScript. Setup uses npm or Yarn and a Prettier configuration file; automatic fixes and configuration files are supported. The package requires Node.js v14.18.0 or later and lists Prettier ^3.0.3 as a peer dependency. Its README describes the plugin as under development, warning that its output may not always match Prettier's formatting. The package is distributed under the MIT license, and its metadata names JounQin as author. The listed plan is a free, MIT-licensed open-source package requiring Node.js v14.18.0 or later.
Good
- Free and MIT-licensed
- Supports a wide range of SQL dialects
- Formatting options include casing and indentation
- Can format embedded SQL in JavaScript
- Supports automatic fixes and configuration files
Watch out
- Requires Node.js v14.18.0 or later
- Under development; output may differ from Prettier formatting
- Prettier ^3.0.3 is a peer dependency
Who it suits
Prettier SQL suits developers who use Prettier and want SQL formatting for supported dialects. It requires a self-hosted setup with Node.js v14.18.0 or later.
Verdict
Prettier SQL adds configurable SQL formatting to Prettier, including support for many dialects and embedded SQL in JavaScript. Its development status and Node.js requirement are important considerations.
Plans and prices
From Prettier SQL's own pricing page, checked 8 Oct 2001.
| Plan | Price | What it gives you |
|---|---|---|
| MIT-licensed open-source package | Free | Prettier plugin · requires Node.js v14.18.0+ |
The facts
Each one read from Prettier SQL's own pages, with the date it was checked.
What it does
- Compatibility
- The package metadata lists Prettier ^3.0.3 as a peer dependency.checked 8 Oct 2001
- Development status
- The README says the plugin is under development and may not always match Prettier's formatting.checked 8 Oct 2001
- Formatting options
- Options include keyword, data type, function, and identifier casing, indentation style, and logical operator line breaks.checked 8 Oct 2001
- How it works
- The plugin uses sql-formatter or node-sql-parser to format SQL files.checked 8 Oct 2001
- License
- The package is distributed under the MIT license.checked 8 Oct 2001
- Purpose
- prettier-plugin-sql adds SQL formatting support to Prettier.checked 8 Oct 2001
- Requirements
- The package requires Node.js v14.18.0 or later, including supported LTS versions.checked 8 Oct 2001
- Setup
- The README shows installation through npm or Yarn and configuration through a Prettier config file.checked 8 Oct 2001
- SQL in JavaScript
- With prettier-plugin-embed, it can format SQL inside tagged template literals.checked 8 Oct 2001
- Supported dialects
- The documented sql-formatter languages include BigQuery, DB2, Hive, MariaDB, MySQL, PostgreSQL, Snowflake, SQLite, T-SQL, Trino, and others.checked 8 Oct 2001
The company
- Maker
- The package metadata names JounQin as its author, and the repository describes itself as a collection of Prettier plugins.checked 8 Oct 2001
Alternatives to Prettier SQL
- 1
Poor SQL
Free planOpen sourceWebAPIExtensionLinux7.3Free plan - 2
SQLFormat.org
Free planOpen sourceWebAPIExtensionSelf-hosted7.1Free plan - 3
sqlfmt
Free planWebAPILinuxSelf-hosted6.7Free plan - 4
RegSQL
Free planWeb6.5From $8 a month - 5
SQLCheck
Free planLinuxmacOSWindows6.5Free plan - 6
sqlfmt
Free planWebAPI6.5From $9 a month
