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 13.0.4 to 13.1.0

lib/languages/db2i/db2i.formatter.js

1

lib/allDialects.js
export { bigquery } from './languages/bigquery/bigquery.formatter.js';
export { db2 } from './languages/db2/db2.formatter.js';
export { db2i } from './languages/db2i/db2i.formatter.js';
export { hive } from './languages/hive/hive.formatter.js';

@@ -4,0 +5,0 @@ export { mariadb } from './languages/mariadb/mariadb.formatter.js';

@@ -531,2 +531,5 @@ // Generated automatically by nearley, version 2.20.1

}, {
"name": "property_access$subexpression$1",
"symbols": ["parameter"]
}, {
"name": "property_access",

@@ -533,0 +536,0 @@ "symbols": ["atomic_expression", "_", lexer.has("DOT") ? {

@@ -8,2 +8,3 @@ import * as allDialects from './allDialects.js';

db2: 'db2',
db2i: 'db2i',
hive: 'hive',

@@ -10,0 +11,0 @@ mariadb: 'mariadb',

export { bigquery } from './languages/bigquery/bigquery.formatter.js';
export { db2 } from './languages/db2/db2.formatter.js';
export { db2i } from './languages/db2i/db2i.formatter.js';
export { hive } from './languages/hive/hive.formatter.js';

@@ -4,0 +5,0 @@ export { mariadb } from './languages/mariadb/mariadb.formatter.js';

3

package.json
{
"name": "sql-formatter",
"version": "13.0.4",
"version": "13.1.0",
"description": "Format whitespace in a SQL query to make it more readable",

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

"db2",
"db2i",
"sqlite",

@@ -40,0 +41,0 @@ "trino",

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

usage: sql-formatter [-h] [-o OUTPUT] \
[-l {bigquery,db2,hive,mariadb,mysql,n1ql,plsql,postgresql,redshift,singlestoredb,snowflake,spark,sql,sqlite,transactsql,trino,tsql}] [-c CONFIG] [--version] [FILE]
[-l {bigquery,db2,db2i,hive,mariadb,mysql,n1ql,plsql,postgresql,redshift,singlestoredb,snowflake,spark,sql,sqlite,transactsql,trino,tsql}] [-c CONFIG] [--version] [FILE]

@@ -111,3 +111,3 @@ SQL Formatter

--fix Update the file in-place
-l, --language {bigquery,db2,hive,mariadb,mysql,n1ql,plsql,postgresql,redshift,singlestoredb,snowflake,spark,sql,sqlite,trino,tsql}
-l, --language {bigquery,db2,db2i,hive,mariadb,mysql,n1ql,plsql,postgresql,redshift,singlestoredb,snowflake,spark,sql,sqlite,trino,tsql}
SQL dialect (defaults to basic sql)

@@ -218,2 +218,31 @@ -c, --config CONFIG

### I'm having a problem with Prettier SQL VSCode extension
The [Prettier SQL VSCode](https://marketplace.visualstudio.com/items?itemName=inferrinizzard.prettier-sql-vscode)
extension is no more maintained by its author.
Please use the official [SQL Formatter VSCode](https://marketplace.visualstudio.com/items?itemName=ReneSaarsoo.sql-formatter-vsc)
extension to get the latest fixes from SQL Formatter library.
### My SQL contains templating syntax which SQL Formatter fails to parse
For example, you might have an SQL like:
```sql
SELECT {col1}, {col2} FROM {tablename}
```
While templating is not directly supported by SQL Formatter, the workaround
is to use [paramTypes](docs/paramTypes.md) config option to treat these
occurances of templating constructs as prepared-statement parameter-placeholders:
```js
format('SELECT {col1}, {col2} FROM {tablename};', {
paramTypes: { custom: [{ regex: String.raw`\{\w+\}` }] },
});
```
This won't work for all possible templating constructs,
but should solve the most common use cases.
## The future

@@ -220,0 +249,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 not supported yet

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

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 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