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.66k stars 100 forks source link

Indentation configuration for functions #323

Open abigailCortis opened 1 year ago

abigailCortis commented 1 year ago

When using pg_formatter on create function statements, I would like to configure the indentation to be as shown in the first code block (where the RETURNS and AS keywords are at the same indentation level as the CREATE keyword) . Is there a way to configure this please?

Code to be formatted as

CREATE OR REPLACE FUNCTION function_name(...)
RETURNS boolean
AS $$
DECLARE
  ...

instead of:

CREATE OR REPLACE FUNCTION function_name(...)
  RETURNS boolean
  AS $$
DECLARE
  ...