A SQL formatter that whitespaces and indents SQL queries for improved readability. Current stable version 0.2.12, last updated in 2018. Forked from sql-formatter, it supports SQL, N1QL, and a subset of standard SQL. Differentiator: simple, no dependencies, but limited to whitespace formatting without comprehensive keyword case or dialect-specific logic. Release cadence is low, mostly maintenance.
npm install sql-prettierNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: importing and formatting a simple SQL query with SELECT, FROM, WHERE, ORDER BY.
If case preservation is needed, consider another formatter (e.g., sql-formatter).
Test with your SQL dialect; use dialect-specific formatters like sql-formatter for MySQL, PostgreSQL.
Use: import sqlPrettier from 'sql-prettier'; then sqlPrettier.format(...)
const sqlPrettier = require('sql-prettier').default;npm install sql-prettier
No dependency data recorded yet.