Open calvindio opened 4 years ago
Unibeautify currently supports sqlformat beautifier for SQL language: https://unibeautify.com/docs/language-sql
List of supported options in sqlformat
's document is found at https://sqlparse.readthedocs.io/en/latest/api/#formatting-of-sql-statements
I do not see a supported option which would satisfy your description. I recommend you request this option in https://github.com/andialbrecht/sqlparse/issues . If sqlformat
adds a new option we can add to Unibeautify's sqlformat beautifier here: https://github.com/Unibeautify/beautifier-sqlformat/blob/master/src/options.ts
Thanks!
Transfered this issue to applicable sqlformat beautifier's repository. If another beautifier supports this option for SQL we could add it, too.
Option Details Name: Closing Bracket Position
If this is a new option, please fill out the below Type (boolean, multi-select, number, etc): multi-select Values (if applicable):
If this is to update an existing option, please describe what should be updated
Additional context From what I think, there are 3 logical possible places to put the closing bracket
1. Common (after the last line of the block, at the same indentation level as the block's opening)
pros
cons
2. Condensed (at the end of the last line of the block)
pros
cons
3. Hybrid (after the last line of the block, at the same indentation level as the block's children)
pros
cons
Right now, I have to turn off autoformatting for sql file (postgresql) because I find it easier to identify create table blocks and understand a complicated select statement with hybrid style bracket. I still use autoformatting for js, ts, etc. because I find the convenience of autoformatting outweigh the cost of > structure of the blocks.