PostgreSQL database exporter using pg_dump, in its custom format.

Requires a connection string and pg_dump on the system PATH. pg_dump is started without a shell (execFile with an argument array): each argument reaches it as it is, and the password of the connection string, a URI's or keyword=value settings', reaches it through PGPASSWORD, not the command line (see pgDumpInvocation). With schema, the export holds that schema alone. Supports both file-based and byte-array exports.

Implements

Constructors

  • Parameters

    • OptionalconnectionString: string | (() => undefined | string | Promise<undefined | string>)

      The database to dump: a connection string, or a function that gives one, or a promise of one, when an export runs. The exporter of an adapter reads the pool the adapter runs on then, and asks a password function of the pool for its password.

    • options: PostgresExporterOptions = {}

      The one schema to export, and what an export with no connection string says.

    Returns PostgresExporter

Methods