Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>SQL Formatter (River Style)New to Visual Studio Code? Get it now.
SQL Formatter (River Style)

SQL Formatter (River Style)

zerocoder

|
3 installs
| (0) | Free
Formats SQL using a right-aligned 'river' keyword style, with recursive alignment for subqueries.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

SQL Formatter (River Style)

A VS Code extension that formats SQL using a right-aligned "river" keyword style, with recursive alignment for subqueries.

SELECT A.COL1,
       A.COL2
  FROM TABLE_A A
 INNER JOIN TABLE_B B ON (A.ID = B.ID)
 WHERE A.STATUS = 'ACTIVE'
 ORDER BY A.COL1 ASC;

Features

  • SELECT — joins, correlated/derived subqueries, CASE, window functions (OVER/PARTITION BY/ORDER BY), UNION/UNION ALL/MINUS/INTERSECT/EXCEPT, GROUP BY/HAVING/QUALIFY/ORDER BY.
  • INSERT — single-row and multi-row VALUES, INSERT ... SELECT, with a hanging-paren wrap for long column/value lists.
  • UPDATE, DELETE.
  • MERGE — USING/ON/WHEN ... THEN with UPDATE SET (aligned = signs), DELETE, and INSERT/VALUES actions.
  • WITH / CTEs — single or multiple CTEs (including WITH RECURSIVE), followed by any supported statement.
  • Case-normalizes reserved keywords to uppercase; identifiers and string literals are left exactly as written.

Usage

  • Format Document: click the format icon in the editor toolbar, or run the command "Format SQL (River Style)" from the Command Palette.
  • Format Selection: select some SQL, right-click, and choose "Format SQL Selection".
  • Minify Selection: select some SQL, right-click, and choose "Minify SQL Selection (Single Line)" to collapse it down to one line per statement — the inverse of formatting, handy for pasting a query into a one-liner script or log. Works on both formatted and unformatted input; comments are dropped.
  • Minify Document: run "Minify SQL Document (Single Line)" from the Command Palette to do the same for the whole file.
  • Applies to files recognized as the sql language, including .sql, .dml, and .ddl files.

Configuration

Setting Default Description
sqlFormatter.maxLineLength 100 Maximum line length before length-triggered lists (GROUP BY/ORDER BY columns, INSERT column/VALUES lists, PARTITION BY/ORDER BY in window functions) wrap one item per line.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft