prettier-plugin-sql-cst review
A flexible Prettier SQL formatter, strongest with SQLite and BigQuery.
Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026
prettier-plugin-sql-cst is an open-source Prettier plugin for formatting SQL files. It uses a concrete syntax tree and Prettier’s formatting algorithm to adjust layout according to expression length while preserving most syntax elements. It is aimed at developers who already use Prettier and want SQL formatting in the same workflow, particularly for SQLite and BigQuery projects.
Formatting controls extend beyond line layout. The plugin supports casing options for SQL keywords, literals, types, identifiers, and functions. It can apply canonical syntax transformations, enforce a final semicolon, and format embedded languages such as JSON and JavaScript. SQL formatting runs through the Prettier command-line tool, and the plugin works with the Prettier Visual Studio Code extension, giving it a direct fit with command-line and editor-based workflows.
The main trade-off is dialect coverage. SQLite and BigQuery are supported parsers, while PostgreSQL, PL/pgSQL, MySQL, and MariaDB parsers are experimental. That makes the plugin a focused choice for teams standardizing SQL presentation through Prettier, especially when their dialect matches the primary parser support. Teams working heavily with the experimental dialects should account for that status before making the plugin their default formatter. As an open-source project with a free plan, it offers formatting, casing, transformation, and editor integration without a paid-plan structure described here.
prettier-plugin-sql-cst pros and cons
- Where it wins
- Formats SQL by expression length with casing controls
- Supports SQLite and BigQuery parsers
- Works with Prettier CLI and Visual Studio Code
- Where it doesn't
- PostgreSQL, PL/pgSQL, MySQL, and MariaDB parsers are experimental
- Requires a Prettier-based formatting workflow
- Dialect support is narrower outside SQLite and BigQuery
prettier-plugin-sql-cst fact sheet, pricing and score →
Advertiser disclosure: iTechGuides is reader-supported. Vendors can pay for top positions in our rankings and for a place on other products' pages, and we may earn a commission when you click some links. Bought places stand at the number bought; this page and our disclosure say so. Paying vendors may get a fuller, more detailed review from our editors, and that review can change their score. How we rank.
Last updated · How we research and update