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/
PostgreSQL License
1.69k stars 101 forks source link

Unattractive formatting of CHECK expression #343

Open aleclarson opened 2 months ago

aleclarson commented 2 months ago

Input

CREATE TYPE person AS (
  id text NOT NULL,
  age integer NOT NULL CHECK (age > 0),
);

Output

CREATE TYPE person AS (
  id text NOT NULL,
  age integer NOT NULL CHECK (
    age > 0),
);

I would prefer the CHECK expression to either not be wrapped or the closing paren should be on its own line.