darold / pgFormatter

A PostgreSQL SQL syntax beautifier that can work as a console program or as a CGI. On-line demo site at http://sqlformat.darold.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible conflict between --wrap-after and --comma-break

dbachhh opened this issue · comments

Hi, thank you so much for this piece of software. I was playing around with the options and there is a strange case where comma-break doesn't work:

pg_format -i test.sql --comma-break --wrap-after 80

INSERT INTO (
    field_one,
    field_two,
    field_three)
VALUES (
    1,
    2,
    3);

pg_format -i test.sql --comma-break

INSERT INTO (
    field_one, field_two, field_three)
VALUES (
    1, 2, 3);

So it seems like wrap-after is in conflict comma-break formatting, would like to ask if this the intended behavior ?

Yes, this is attended. The --wrap-after option is used to force a break when a comma is encountered around the 80th characters, in this case the --comma-break option can not be used, it has no more sens.