Skip to content
SPECIFICTION
Get listed

prettier-plugin-sql-cst

github.com

Web
Visit github.com
Spec score 6.9 #25 of 26 in SQL Linters and Formatters

Spec sheet

Purpose
It is a Prettier plugin for formatting SQL that uses sql-parser-cst and Prettier’s formatting algorithm.Read 8 Oct 2026 · github.com
License
The repository identifies the project as GPL-3.0 licensed.Read 8 Oct 2026 · github.com
Bound parameters
Bound SQL parameter placeholders are rejected by default, and users can configure sqlParamTypes to recognize specified placeholder forms.Read 8 Oct 2026 · github.com
Configuration
It supports Prettier’s printWidth, tabWidth, and useTabs options, plus SQL-specific options for keyword, literal, type, identifier, and function casing.Read 8 Oct 2026 · github.com
Dialect limits
The experimental dialects are limited by incomplete parser syntax support, and the README says unsupported SQL sections can be bracketed with special comments to disable parsing.Read 8 Oct 2026 · github.com
Editor integration
The plugin can be used with Prettier’s VSCode extension, configured as the default formatter, with document selectors potentially needed for SQL files.Read 8 Oct 2026 · github.com
Embedded SQL
The README recommends using prettier-plugin-embed together with this plugin to format SQL strings inside JavaScript files.Read 8 Oct 2026 · github.com
Experimental dialects
PostgreSQL, PL/pgSQL, MySQL, and MariaDB are listed as experimental, and the README says parser syntax support is incomplete for these dialects.Read 8 Oct 2026 · github.com
Formatting
It adapts SQL layout to expression length, placing longer clauses and their contents on separate lines as needed.Read 8 Oct 2026 · github.com
Installation
The README gives npm, pnpm, and yarn commands for installing the plugin with Prettier as a development dependency.Read 8 Oct 2026 · github.com
Limitations
The README says SQL formatting style details remain subject to change and describes identifier and function case options as experimental and not thoroughly tested.Read 8 Oct 2026 · github.com
Live demo
The project README links to a live SQL formatting playground.Read 8 Oct 2026 · github.com
Maintainer
The maintainer profile identifies Rene Saarsoo and lists Tartu, Estonia as his location.Read 8 Oct 2026 · github.com
Style
Its stated formatting philosophy is to use one style, avoid configuration options, format embedded languages, and preserve syntax when uncertain.Read 8 Oct 2026 · github.com
Supported dialects
SQLite and BigQuery have full support; PostgreSQL, PL/pgSQL, MySQL, and MariaDB are experimental.Read 8 Oct 2026 · github.com

Where Specifiction places it

Alternatives to prettier-plugin-sql-cstAll alternatives →