Skip to content

nathancahill/pgformatter

Repository files navigation

pgformatter

Thin Python wrapper for pgFormatter. Compatible with AWS Lambda or any environment with Perl.

from pgformatter import pg_format

pg_format(
    b"""
SELECT f.title, f.did, d.name, f.date_prod, f.kind
    FROM distributors d, films f
    WHERE f.did = d.did
"""
)
SELECT
    f.title,
    f.did,
    d.name,
    f.date_prod,
    f.kind
FROM
    distributors d,
    films f
WHERE
    f.did = d.did