Socket
Socket
Sign inDemoInstall

sql-formatter

Package Overview
Dependencies
Maintainers
2
Versions
142
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sql-formatter - npm Package Compare versions

Comparing version 12.0.0-beta.2 to 12.0.0-beta.3

2

lib/languages/trino/trino.formatter.js

@@ -56,3 +56,3 @@ import { expandPhrases } from '../../expandPhrases.js';

},
operators: ['%', '->', ':', '||', // Row pattern syntax
operators: ['%', '->', '=>', ':', '||', // Row pattern syntax
'|', '^', '$' // '?', conflicts with positional placeholders

@@ -59,0 +59,0 @@ ]

{
"name": "sql-formatter",
"version": "12.0.0-beta.2",
"version": "12.0.0-beta.3",
"description": "Format whitespace in a SQL query to make it more readable",

@@ -71,2 +71,3 @@ "license": "MIT",

"Olexandr Sydorchuk <olexandr.syd@gmail.com>",
"Pavel Djundik <xPaw@users.noreply.github.com>",
"Rafael Pinto <raprp@posteo.de>",

@@ -73,0 +74,0 @@ "Rahel Rjadnev-Meristo <rahelini@gmail.com>",

@@ -41,3 +41,3 @@ <a href='https://github.com/sql-formatter-org/sql-formatter'><img src="static/prettier-sql-clean.svg" width="128"/></a>

console.log(format('SELECT * FROM tbl'));
console.log(format('SELECT * FROM tbl', { language: 'mysql' }));
```

@@ -154,4 +154,4 @@

- [**`logicalOperatorNewline`**](docs/logicalOperatorNewline.md) newline before or after boolean operator (AND, OR, XOR).
- [**`tabulateAlias`**](docs/tabulateAlias.md) aligns column aliases vertically.
- [**`commaPosition`**](docs/commaPosition.md) where to place the comma in column lists.
- [**`tabulateAlias`**](docs/tabulateAlias.md) aligns column aliases vertically (**unstable!**).
- [**`commaPosition`**](docs/commaPosition.md) where to place the comma in column lists (**unstable!**).
- [**`expressionWidth`**](docs/expressionWidth.md) maximum number of characters in parenthesized expressions to be kept on single line.

@@ -175,2 +175,22 @@ - [**`linesBetweenQueries`**](docs/linesBetweenQueries.md) how many newlines to insert between queries.

## Frequently Asked Questions
### Parse error: Unexpected ... at line ...
The most common cause is that you haven't specified an SQL dialect.
Instead of calling the library simply:
```js
format('select [col] from tbl');
// Throws: Parse error: Unexpected "[col] from" at line 1 column 8
```
pick the proper dialect, like:
```js
format('select [col] from tbl', { language: 'transactsql' });
```
Or when using the VSCode extension: Settings -> Prettier-SQL: SQLFlavourOverride.
## Contributing

@@ -177,0 +197,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc