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

How to preserve as least 1 newline between comments? #328

Open Norlandz opened 11 months ago

Norlandz commented 11 months ago

How to preserve as least 1 newline between comments?

Give:

-- comment AA

-- comment BB
-- comment CC

drop table if exists accounts;

-- comment DD

Expected output:

remove extra newlines between comments &/ statements; but preserve at least one.

-- comment AA

-- comment BB
-- comment CC

drop table if exists accounts;

-- comment DD

Current output:

All newlines between comments &/ statements are removed.

-- comment AA
-- comment BB
-- comment CC
drop table if exists accounts;

-- comment DD