sql-formatter
sql-formatter copied to clipboard
A whitespace formatter for different query languages
This pull request adds support for the DuckDB SQL dialect to the SQL Formatter library. **Description:** - Extends the supported dialects to include DuckDB. - Updates the documentation (README.md and...
**Input data** Which SQL and options did you provide as input? ```sql Select * From #temp as A left join table as B on A.ID = B.ID ``` **Expected Output**...
**Input data** Which SQL and options did you provide as input? ```sql STRUCT ``` **Expected Output** ```sql STRUCT ``` **Actual Output** ```sql ERROR: Parse error: Unexpected: STRING ``` **Usage** -...
**Input data** SELECT webhook_data_json.unified_receipt.latest_receipt_info[0].is_trial_period::boolean **Expected Output** SQL to be formatted. **Actual Output** Unable to format SQL: Error: Parse error: Unexpected "[0].is_tri" at line 5 column 112 **Usage** - How are...
**Input data** Which SQL and options did you provide as input? ```sql create table player_match_details( name varchar(150), match varchar(150), score int ); ``` **Expected Output** ```sql CREATE TABLE player_match_details( name...
**Input data** Which SQL and options did you provide as input? defaults ```sql DECLARE v_id1 varchar2(5) := '01'; v_id2 varchar2(5) := '02'; BEGIN CASE v_id1 WHEN '01' THEN v_id1 :=...
```sql CREATE OR REPLACE STAGE test URL = 'azure://test.blob.core.windows.net/test/testfolder' STORAGE_INTEGRATION = DATALAKE_SI FILE_FORMAT = (TYPE = 'AVRO'); -- list stage list @test; ``` **Expected Output** Prettier output **Actual Output** Unable...
[duckdb](https://duckdb.org/) is getting a lot of attention as a fast in-process analytical database. I found out that duckdb is [not currently supported](https://github.com/sql-formatter-org/sql-formatter/blob/master/docs/dialect.md). I am currently using `spark` option, but it...
**Describe the bug** When an alias for a table or expression is called "call", the formatter throws an error when trying to access its fields. **Expected behavior** Running ``` sql...
Currently the VS Code extension only works with "sql" language files and i'd appreciate if it could also work with "oracle_sql" language files, the default for PL/SQL. Is this possible?