Giter Site home page Giter Site logo

sql-formatter-vscode's Introduction

SQL Formatter VSCode version number

Formats SQL files using the sql-formatter library.

Note: This extension is a direct successor of Prettier SQL VSCode extension, which is no more maintained.

Supports the following SQL Dialects:

  • Standard SQL
  • BigQuery
  • DB2 for LUW (Linux, Unix, Windows)
  • DB2 for IBM iSystem
  • Hive
  • MariaDB
  • MySQL
  • N1QL
  • PL/SQL
  • PostgresQL
  • Amazon Redshift
  • SingleStoreDB
  • Snowflake
  • Spark
  • SQLite
  • Trino (Presto)
  • TransactSQL

Configuration

  • dialect: The SQL dialect to use when parsing the SQL files for formatting.

    It is recommended to explicitly set this option.

    By default the formatter relies on VSCode to provide it information about the SQL dialect you're using, but this depends heavily on your VSCode environment and other extensions you have installed.

  • ignoreTabSettings: Whether to ignore VSCode user/workspace settings for tabSize and insertSpaces

  • tabSizeOverride: Overrides tabSize if ignoreTabSettings is enabled

  • insertSpacesOverride: Overrides insertSpaces if ignoreTabSettings is enabled

  • keywordCase: Whether to print keywords in ALL CAPS or lowercase

  • dataTypeCase: Whether to print data types in ALL CAPS or lowercase

  • functionCase: Whether to print function names in ALL CAPS or lowercase

  • identifierCase: Whether to print identifiers in ALL CAPS or lowercase (experimental)

  • indentStyle: Switched between standard keyword positioning vs maintaining a central space column

  • logicalOperatorNewline: Whether to break before or after AND and OR

  • expressionWidth: Number of characters allowed in each line before breaking

  • linesBetweenQueries: How many newlines to place between each query / statement

  • denseOperators: Whether to strip whitespace around operators such as + or >=

  • newlineBeforeSemicolon: Whether to place semicolon on its own line or on previous line

  • paramTypes: Specifies parameter placeholders types to support

Having a problem?

Please report issues to SQL Formatter library Github page.

This extension and the sql-formatter libary share the same issue tracker, as the authors of both are the same and the bugs reported about the VSCode extension are really mostly bugs in the underlying formatter library.

Don't worry about this difference though when reporting problems. But do read the FAQ before filing your report.

Release process

  • Bump the version number
  • Add entry to changelog
  • Commit and tag the version
  • run yarn vsce:package
  • Go to VSCode marketplace
  • Select SQL Formatter VSCode -> Update

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.