1.2.5 • Published 2 years ago

@sqltools/formatter v1.2.5

Weekly downloads
297,755
License
MIT
Repository
github
Last release
2 years ago

SQLTools Formatter

GitHub

Forked from zeroturnaround/sql-formatter but with improvements and ported Typescript.

This package is part of vscode-sqltools extension.

Try it online using our playground.

Install

Get the latest version from NPM/Yarn:

npm install @sqltools/formatter
#
yarn add @sqltools/formatter

Usage

import sqlFormatter from '@sqltools/formatter';

console.log(sqlFormatter.format('SELECT * FROM table1'));

Will output:

SELECT *
FROM table1

You can also pass in configuration options:

sqlFormatter.format('SELECT *', {
  language: 'sql',
  indent: '\t', // Defaults to two spaces
});

Options

optiondescriptiontypedefault
languageQuery language, default is Standard SQLsql, n1ql, db2, pl/sqlsql
indentCharacters used for indentationstring (2 spaces)
reservedWordCaseHow to change the case of reserved wordsupper, lower, nullnull (no change)
linesBetweenQueriesHow many line breaks between queriesnumber or 'preserve'1
paramsCollection of params for placeholder replacementobject for name params, array for indexed placeholders

Changelog

v1.2.4

v1.2.3

v1.2.2

  • Add playground link and options to README.md
  • Emitting declarations files for usage with Typescript.

v1.2.1

  • Fixes JSON operators not inserting spaces. Issue #605
  • Fixes Grant type queries. Issue #460

v1.2.1

  • (Almost) first public version
@imnotjames/typeormtypeorm-forkbeamsorrasak-typeorm@beamdev/typeorm@joinlifex/typeorm-controlled-connection@intelliscl/typeorm@infinitebrahmanuniverse/nolb-_sqtypeorm@everything-registry/sub-chunk-861@roxavn/clizubuhealth-typeormtypeorm-native@loyaltylion/typeormtenancy-typeorm@imagineapps/i-typeormtypeorm-pscaletypeorm-hgtypeorm-react-nativetypeorm-legacy-mssqltypeorm-migrations-plugintypeorm-mongodb-v4typeorm-morgan-forktypeorm-react-native-dotechtypeorm-sladhetypeorm-connection-in-entitytypeorm-customtypeorm-db2typeorm-steroidstypeorm-disable-constraint-optiontypeorm-dm8typeorm-dmdbtypeorm-dmdb8typeorm-without-pooltypeormotypeorm-btypeorm-bentypeorm-chongtypeorm-firewilson208-typeorm@horizon-plaza/typeorm@hqh070707/nestjs-commons@medusajs/typeorm@microservice-stack/nest-typeorm-migrations@madxnl/typeorm@matthewberryman/typeorm@n8n/typeorm@myunisoft/typeorm@nanangqq/typeorm@nativescript-community/typeorm@nexus211/typeorm@kyoforing/typeorm@lagregance/typeorm@joinlifex/typeorm@jonasbpa/typeorm@rexpan/typeorm@edge-js/typeorm@pantherx.dev/common@hckrnews/typeorm@przemyslawwalczak/typeorm@punks/typeorm@ordidxzero/typeorm@optimiz.me/typeorm@oxeye/typeorm@paar-it-gmbh/typeorm@seniorplace/typeormjavanlacerda-typeorm@sap/hana-sqlscript-lsp@ericlewis/typeorm@erpairforce/typeorm@short.io/typeorm@evidence-dev/query-store@flowaccount/typeormhomebridge-assistant-ui@synconset/typeorm@steroidsjs/typeorm@steroidsjs/nest@stigg/typeorm@th3unkn0wn/typeorm@student-coin/typeorm-patchedmyvcnestjs-typeorm-commands@bustle/typeorm-postgres@butlerlabs/typeorm@bkstorm/typeorm@blueleader07/typeormmy-typeorm@softwareplumbers/typeorm@twenix/typeorm@twotwentythree/typeormmrsctest@arthurking/typeorm@artrainbow/typeorm@claes-npm/typeorm@cleo/typeorm@caliobase/typeorm-migrations@bouncecode/typeorm@craft.co/typeorm-scoped@crunkstar/typeorm@woofwoof/plugins@zivac/typeorm2
1.2.5

2 years ago

1.2.3

3 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.0

5 years ago

0.0.0

5 years ago