1.0.3 • Published 3 years ago

fmt-sql v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Install

Get the latest version from NPM/Yarn:

npm install fmt-sql
#
yarn add fmt-sql

Usage

import sqlFormatter from 'fmt-sql';

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
1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago