pgFormatter icon indicating copy to clipboard operation
pgFormatter copied to clipboard

Conflict between wrap limit and placeholder

Open bever1337 opened this issue 1 year ago • 0 comments

When a sql file contains a psql command, the command must be on one line. Restated, the command can not wrap.

I configure pgformatter with a placeholder regex ^\\ and pgformatter ignores the psql commands as-expected.

Eventually I write a long psql copy command, and my project's wrap limit applies and wraps the previously ignored line.

Example solutions:

  • pgformatter never wraps psql commands
  • pgformatter does not apply wrap to lines matching placeholder or multiline

I cannot find any documentation supporting the claim "developers cannot split psql commands," but I can confirm this is true with my own use of /copy on postgres 16, and this (admittedly old) mailing list thread: https://www.postgresql.org/message-id/flat/20101112220340.36a0bc75%40dick.coachhouse

Thanks so much for the amazing project.

bever1337 avatar Nov 26 '24 01:11 bever1337