Skip to content

Feature Request: Detect dialect inside a comment or filename #764

@kermes

Description

@kermes

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions