-
Notifications
You must be signed in to change notification settings - Fork 429
Description
Describe the Feature
Allow defining a custom quote
type for a dialect.
Why do you want this feature?
As I explained in #306, I would like to define a custom grammar of Trino SQL queries + {{Handlebars templates}}
so that users can write (and format with sql-formatter) queries like this
select
{{ country_code }}
from
my_table
and we could render the query for other users with a dropdown in place of {{ country_code }}
. The easiest way to do this is to make make sql-formatter treat {{}}
like a type of string. In order to do this, we need to have a regex for this type of quote in quotePatterns
. It makes no sense to add this to sql-formatter itself, so we have to fork it to add this custom quote type. It would be nice if I could pass the regex somehow through DialectOptions
' tokenizerOptions.stringTypes
or some other way.