You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My guess is we're parsing this as a triple-quoted expression followed by a single quote. We get this right (postgres dollar sign quotes):
select $$'$$ || 'quoted_text' || $$'$$
I thought triple quotes for string literals were more common, but a quick search of pg, mysql, sql server, snowflake, and bq shows that only bigquery allows them. maybe we should pull those out into a bq-specific dialect.
Describe the bug
sqlfmt fails to parse valid SQL when using string literals that contain single quotes.
To Reproduce
Expected behavior
sqlfmt runs without errors.
Actual behavior
Additional context
Reproducible from https://sqlfmt.com/
These two are formatted without errors by sqlfmt, so it's only some specific combinations that break the parsing:
The text was updated successfully, but these errors were encountered: