tconbeer / sqlfmt

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

Don't break union all by name into two lines #611

Closed aersam closed 1 month ago

aersam commented 1 month ago

Describe the bug If I use union all by name sqlfmt formats this as union all\nby name which is a bit annoying

To Reproduce

import sqlfmt.api

print(sqlfmt.api.format_string("select * from foo union all by name select * from bar", mode=sqlfmt.api.Mode()))

Expected behavior Should output:

select * 
from foo 
union all by name  
select * 
from bar 

Actual behavior

select * 
from foo 
union all
by name  
select * 
from bar 

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

tconbeer commented 1 month ago

TIL about union all by name. Thank you

tconbeer commented 1 month ago

just shipped a patch in 0.22.0 -- thanks for the report!