Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prettier SQL

Welcome to Prettier SQL, a Visual Studio Code extension that formats SQL code. This extension helps you maintain clean and consistent SQL code formatting, making it easier to read and understand.

Features

SQL dialect support

Prettier SQL supports various SQL dialects, including:

  • auto,
  • sql,
  • bigquery,
  • clickhouse,
  • db2,
  • db2i,
  • duckdb,
  • hive,
  • mariadb,
  • mysql,
  • tidb,
  • n1ql,
  • plsql,
  • oracle,
  • postgresql,
  • redshift,
  • singlestoredb,
  • snowflake,
  • spark,
  • sqlite,
  • mssql,
  • mssqlserver,
  • transactsql,
  • trino

Development setup

  1. Install:

    git clone https://github.com/olton/prettier-sql.git
    cd prettier-sql
  2. Build extension sources:

    npm run build
  3. Open this project in VS Code and press F5 to start the Extension Development Host.

Installation

Usage

  1. Open a .sql file.
  2. Run Format Document or command PrettierSQL: Format.
  3. Optionally select part of SQL and run Format Selection for range formatting.
  4. Configure behavior in VS Code settings with these options:
  • prettiersql.enable
  • prettiersql.tabSize
  • prettiersql.useTabs
  • prettiersql.singleQuote
  • prettiersql.operatorNewLine
  • prettiersql.operatorCase (none | upper | lower)
  • prettiersql.dialect

The extension uses sql-formatter under the hood and applies the options above during formatting. When prettiersql.dialect is auto, the formatter infers a dialect from current editor language id.

Contributing

Contributions are welcome. Feel free to submit a pull request or open an issue.

Support

If you like this project, please consider supporting it by:

  • Star this repository on GitHub
  • Sponsor this project on GitHub Sponsors
  • PayPal to serhii@pimenov.com.ua.
  • Patreon
  • Buy me a coffee

Copyright (c) 2026 by Serhii Pimenov. All Rights Reserved.

About

Prettier SQL, a Visual Studio Code extension that formats SQL code

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages