Download Latest Version pgFormatter-5.3.tar.gz (1.3 MB)
Email in envelope

Get an email when there's a new version of pgFormatter

Home / 3.4
Name Modified Size InfoDownloads / Week
Parent folder
README.txt 2019-04-21 6.0 kB
pgFormatter-3.4.tar.gz 2019-04-21 105.3 kB
Totals: 2 Items   111.3 kB 0
April 21 2018 - v3.4

This release fixes several issues reported by users since the last
six months and adds lot of improvements in code formatting:

  * Add -W, --wrap-after option to set number of column after which
    lists must be wrapped. Default is to puts every item on its own
    line.
  * Add 'Wrap after' option to CGI in the indentation section to
    support the -W | --wrap_atfer command line option in CGI mode.
  * Add -w | --wrap-limit command line option to be able to to wrap
    queries at a certain length. This option is not available in CGI
    mode.
  * Allow uploaded file content-type to be application/octet-stream.
  * Allow a single $ sign in object name.
  * Major optimization of function detection, speed difference is 10
    time faster.
  * Better detection of function versus keyword with same name.
  * Add WORK, GENERATED and IDENTITY as PostgreSQL keyword.
  * Add array_remove and array_replace to the list of PostgreSQL
    functions.
  * Add detection of code separator after DO keyword if it starts
    with a dollar sign.
  * Add new option -t | --format-type to try another formatting type
    for some statements. At this stage it will just use a multi-line
    format in POLICY and PUBLICATION statements. It also introduce
    newline in parameter function list.
  * Add formatting of CREATE POLICY statements.
  * Add information about (Neo)vim plugin and Visual Studio use of
    pgFormatter to format PLPGSQL and SQL code.

Here is the complete list of changes and acknowledgments:

  - Add regression test for --wrap_after option.
  - Fix for sub _indent if $self->{ '_level' } is undefined. Thanks
    to NisSAM for the patch.
  - Add information about special formatting done by -t, -w and -W.
  - Add -W, --wrap-after option to set number of column after which
    lists must be wrapped. Default: puts every item on its own line.
    This applies to SELECT and FROM list. For example:
    
        SELECT a, b, c, d FROM t_1, t_2, t3 WHERE a = 10 AND b = 10;
    
    is formatted into:
    
        SELECT a, b, c, d
        FROM t_1, t_2, t3
        WHERE a = 10
            AND b = 10;
    
    Note this formatting doesn't fits well with sub queries in list.
    Thanks to Bruce Momjian for the feature request.
  - Add information about the (Neo)vim plugin used to format code for
    many file types and that support pgFormatter to format SQL file
    type. Thanks to Anders Riutta for the patch to (Neo)vim.
  - Fix incorrect indentation of sub-select in function. Thanks to
    Ben Hutton for the report.
  - Fix indentation error on case statements in CTE. Thanks to Brent
    Anderson for the report.
  - Reset ->{'_level'} before call to new beautify request. Thanks to
    NisSAM for the report.
  - Fix indent into BEGIN WORK|TRANSACTION and remove extra new line
    between statement in BEGIN blocs. Thanks to Bruce Momjian for the
    report.
  - Add -w | --wrap-limit command line option to be able to to wrap
    queries at a certain length. Note that this could break the code
    formatting effort of pgFormatter but be useful in some case.
  - Update copyright year.
  - Allow a single $ sign in object name otherwise it must be quoted.
    Thanks to NisSAM for the report.
  - Fix extra newline between DELETE SET NULL, add case to regression
    tests. Thanks to Dmitry Chekanov for the report.
  - Major optimization of function detection, difference is 10 time
    faster. Thanks to NisSAM for the patch.
  - Fix formatting of first level of AND / OR
  - Fix unexpected extra indentation in CASE statement. Thanks to
    jostem for the report.
  - Fix newline between RAISE and EXCEPTION and extra indentation
    after IF statements.
  - Better detection of function versus keyword when they have the
    same name. Thanks to Huan Ruan for the report.
  - Fix non breaking columns out into newlines in the next CTE. Thanks
    to Collin Meyers for the report.
  - Add extra newline before a comment /* */ when the last token is ;
    for better reading. Thanks to Shon Frazier for the feature request
  - Add GENERATED and IDENTITY PostgreSQL keyword and remove newline
    character after GENERATED BY. Thanks to madflow for the report.
  - Allow uploaded file content-type to be application/octet-stream.
  - Add a test on uploaded file to be text file (-T).
  - Add information about Perl CGI module requirement. Thanks to Huan
    Ruan for the report.
  - Add array_remove() and array_replace() to the list of PostgreSQL
    functions.
  - Fix bad indentation after IF EXISTS clause. Thanks to jostem for
    the report.
  - Add detection of code separator after DO keyword if it starts with
    a dollar sign.
  - Using -t (try another format type) puts arguments for functions
    on multiple lines for readability. Thanks to Dan Lynch for the
    feature request.
  - Fix typo, thank to David Lynch for the report.
  - Update documentation about the -t option and add link to a Visual
    Studio extension to format PostgreSQL SQL and PLPGSQL using
    pgFormatter. Thanks to Brady Holt for the extension.
  - Add new option: -t | --format-type to try another formatting type
    for some statements. At this stage it will just use a multi-line
    format in POLICY and PUBLICATION statements. Thanks to Dan Lynch
    for the feature request.
  - Fix formatting of EXCLUDE/USING clause in constraint/indexes.
    Thanks to Dan Lynch for the report.
  - Improve trigger formatting. Thanks to Dan Lynch for the report.
  - Fix newline inserted after a semicolon in comment statements.
    Thanks to Dan Lynch for the report.
  - Add formatting of CREATE POLICY statements. Thanks to Dan Lynch
    for the report.
  - Preserve indentation at end of a create table statement when it
    called inside a block. Thanks to visciang for the report.
  - Fix formatting of OVER clause.
  - Fix missing PARTITION keyword outside main table.
  - Fix typo in REMAINDER keyword and move OF keyword to PG list.

Source: README.txt, updated 2019-04-21