Open albertsgrc opened 6 months ago
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: