sql-formatter icon indicating copy to clipboard operation
sql-formatter copied to clipboard

Feature Request: Detect dialect inside a comment or filename

Open kermes opened this issue 1 year ago • 1 comments

Describe the Feature just like the /* sql-formatter-disable */ feature, would love to be able to specify the dialect inside a comment before the query. Maybe something like /* sql-formatter-dialect: postgresql */ in the first line of the file.

Why do you want this feature? Specially in vscode extension, where one project can have multiple dialects in different files but you're currently forced to choose one only for the whole project in the extension settings

Alternative Another solution could be to identify the dialect in the filename, so myquery.snowflake.sql or even myquery.postgresql could be used to pick the correct dialect.

kermes avatar Aug 06 '24 14:08 kermes

This would be fantastic. Running into this issue right now in VS Code where I have one project that uses two different dialects.

riziles avatar Nov 22 '24 23:11 riziles