Skip to content

Commit 9820e58

Browse files
authored
Merge PR #454: Add support for Snowflake Language
2 parents 67f4174 + d06421a commit 9820e58

16 files changed

+1242
-22
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
It started as a port of a [PHP Library][], but has since considerably diverged.
88

99
It supports various SQL dialects:
10-
GCP BigQuery, IBM DB2, Apache Hive, MariaDB, MySQL, Couchbase N1QL, Oracle PL/SQL, PostgreSQL, Amazon Redshift, SingleStoreDB, Spark, SQL Server Transact-SQL, Trino/Presto.
10+
GCP BigQuery, IBM DB2, Apache Hive, MariaDB, MySQL, Couchbase N1QL, Oracle PL/SQL, PostgreSQL, Amazon Redshift, SingleStoreDB, Snowflake, Spark, SQL Server Transact-SQL, Trino/Presto.
1111
See [language option docs](docs/language.md) for more details.
1212

1313
It does not support:
@@ -95,7 +95,7 @@ sql-formatter -h
9595

9696
```
9797
usage: sql-formatter [-h] [-o OUTPUT] \
98-
[-l {bigquery,db2,hive,mariadb,mysql,n1ql,plsql,postgresql,redshift,singlestoredb,spark,sql,sqlite,transactsql,trino,tsql}] [-c CONFIG] [--version] [FILE]
98+
[-l {bigquery,db2,hive,mariadb,mysql,n1ql,plsql,postgresql,redshift,singlestoredb,snowflake,spark,sql,sqlite,transactsql,trino,tsql}] [-c CONFIG] [--version] [FILE]
9999
100100
SQL Formatter
101101
@@ -106,7 +106,7 @@ optional arguments:
106106
-h, --help show this help message and exit
107107
-o, --output OUTPUT
108108
File to write SQL output (defaults to stdout)
109-
-l, --language {bigquery,db2,hive,mariadb,mysql,n1ql,plsql,postgresql,redshift,singlestoredb,spark,sql,sqlite,trino,tsql}
109+
-l, --language {bigquery,db2,hive,mariadb,mysql,n1ql,plsql,postgresql,redshift,singlestoredb,snowflake,spark,sql,sqlite,trino,tsql}
110110
SQL dialect (defaults to basic sql)
111111
-c, --config CONFIG
112112
Path to config json file (will use default configs if unspecified)

docs/language.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Specifies the SQL dialect to use.
1515
- `"postgresql"` - [PostgreSQL][]
1616
- `"redshift"` - [Amazon Redshift][]
1717
- `"singlestoredb"` - [SingleStoreDB][]
18+
- `"snowflake"` - [Snowflake][]
1819
- `"spark"` - [Spark][]
1920
- `"sqlite"` - [SQLite][sqlite]
2021
- `"transactsql"` or `"tsql"` - [SQL Server Transact-SQL][tsql]
@@ -61,6 +62,7 @@ You likely only want to use this if your other alternative is to fork SQL Format
6162
[presto]: https://prestodb.io/docs/current/
6263
[amazon redshift]: https://docs.aws.amazon.com/redshift/latest/dg/cm_chap_SQLCommandRef.html
6364
[singlestoredb]: https://docs.singlestore.com/managed-service/en/reference.html
65+
[snowflake]: https://docs.snowflake.com/en/index.html
6466
[spark]: https://spark.apache.org/docs/latest/api/sql/index.html
6567
[sqlite]: https://sqlite.org/index.html
6668
[trino]: https://trino.io/docs/current/

docs/params.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ The placeholder types available by default depend on SQL dialect used:
117117
- plsql - `:1`, `:name`
118118
- postgresql - `$1`
119119
- redshift - `$1`
120+
- snowflake - _no support_
120121
- sqlite - `?`, `?1`, `:name`, `@name`, `$name`
121122
- spark - _no support_
122123
- tsql - `@name`, `@"name"`, `@[name]`

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"sqlite",
3838
"trino",
3939
"presto",
40-
"prestosql"
40+
"prestosql",
41+
"snowflake"
4142
],
4243
"contributors": [
4344
"Adrien Pyke <[email protected]>",

0 commit comments

Comments
 (0)