tconbeer / sqlfmt

sqlfmt formats your dbt SQL files so you don't have to
https://sqlfmt.com
Apache License 2.0
364 stars 15 forks source link

parsing error for postgress set #573

Closed nstringham closed 3 months ago

nstringham commented 3 months ago

Describe the bug when a set statement is used the parser crashes

To Reproduce try formatting a file that starts like`

\set ON_ERROR_STOP true

Expected behavior it should format or ignore it

Actual behavior it has crashes

Additional context What is the output of sqlfmt --version?

sqlfmt, version 0.21.2

This makes sqlfmt unusable as a pre commit hook

tconbeer commented 3 months ago

set is a SQL command, but \set is not -- are you trying to sqlfmt a psql script?

nstringham commented 3 months ago

Yes it is a psql script.

tconbeer commented 3 months ago

I would say works as intended, then?