Postgres extractor

PostgreSQL or Postgres is an open-source relational database system. Postgres supports both SQL (relational) and JSON (non-relational) querying. TriplyETL has a dedicated fromPostgres() extractor to retrieve data from a Postgres database.

Basic usage

The Postgres extractor is imported in the following way:

import { fromPostgres, Source } from '@triplyetl/etl/generic'

The following code snippet extracts records form a public database URL:

  'select * from rnc_database',
  { url: 'postgres://' }

Connector configuration

Alternatively, a Postgres dataset can be accessed via connector configuration.

The following code snippet accesses the same public database, but uses connector configuration to do so:

  'select * from rnc_database',
    host: '',
    port: 5432,
    database: 'pfmegrnargs',
    user: 'reader',
    password: 'NWDMCE5xdipIjRrp',