Open
Description
Describe the bug
This is similar to this closed issue: #700. I'm unable to format a valid SQLServer statement. Using the demo, there appears to be no language selection that doesn't error.
Expected behavior
Output should be formatted.
Actual behavior
Got this error:
Error: Parse error: Unexpected "[Contact] " at line 1 column 6.
This likely happens because you're using the default "sql" dialect.
If possible, please select a more specific dialect (like sqlite, postgresql, etc).
Usage
import { format } from 'sql-formatter';
let sql_string = "WITH [Contact] AS (SELECT [ContactID], [FirstName], [LastName] FROM [dbo].[Contact])";
format(sql_string, { language: 'sql' })
-
What SQL language(s) does this apply to?
SQLServer -
Which SQL Formatter version are you using?
sql
I'm on 15.3.1 so I figured opening a new issue was prudent.