[ANNOUNCE] sql_insert_writer v0.1.0 - Mailing list pgsql-announce

From Catherine Devlin
Subject [ANNOUNCE] sql_insert_writer v0.1.0
Date
Msg-id CAGCtaoPiGf-Ls6QosnLTrkPy7WAUuXUiWvvOf85e3z0a0teJ0Q@mail.gmail.com
Whole thread Raw
List pgsql-announce
Announcing sql_insert_writer, a Python3 utility to build skeletons for INSERT and INSERT FROM statements, with explicit target column lists and clarifying comments.


Usage example (assumes that the `pip` package manager has been installed, and a local database `zoo` with tables `pet`, `animal`)

    $ pip install sql-insert-writer psycopg2
    $ export DATABASE_URL=postgresql:///zoo
    $ sql_insert_writer pet

INSERT INTO pet ( id, name, species_name, planet, kg
)
VALUES
( DEFAULT,  -- ==> id DEFAULT,  -- ==> name DEFAULT,  -- ==> species_name DEFAULT,  -- ==> planet DEFAULT  -- ==> kg
)
    $ sql_insert_writer pet animal

INSERT INTO pet ( id, name, species_name, planet, kg
)
SELECT id,  -- ==> id name,  -- ==> name species_name,  -- ==> species_name planet,  -- ==> planet DEFAULT  -- ==> kg
FROM animal
--
- Catherine @ 18F

pgsql-announce by date:

Previous
From: Monica Real Amores
Date:
Subject: [ANNOUNCE] repmgr v4.0 Beta Now Available
Next
From: Daniele Varrazzo
Date:
Subject: [ANNOUNCE] pg_repack 1.4.2 released