Skip to main content

PostgreSQL

Connect with your PostgreSQL servers via node-postgres.

Installation

  1. Install package

    npm i @vulcan-sql/extension-driver-pg
    info

    If you run Vulcan with Docker, you should use the command vulcan-install @vulcan-sql/extension-driver-pg instead.

  2. Update vulcan.yaml, and enable the extension.

    extensions:
    ...
    pg: '@vulcan-sql/extension-driver-pg' # Add this line
  3. Create a new profile in profiles.yaml or in your profile files. For example:

    - name: pg # profile name
    type: pg
    connection:
    host: example.com
    port: 5432
    user: postgres
    password: some-secret
    database: postgres

Configuration

NameRequiredDefaultDescription
chunkSizeN100The max rows we should fetch once.
maxN10The maximum number of clients the pool should contain.
idleTimeoutMillisN10000The number of milliseconds a client must sit idle in the pool and not be checked out before it is disconnected from the backend and discarded.
connectionTimeoutMillisN0The number of milliseconds to wait before timing out when connecting a new client by default this is 0 which means no timeout.
userNThe user to connect to the database. Default env.PGUSER or env.USER
passwordNPassword to connect to database. default env.PGPASSWORD
hostNServer host. default env.PGHOS
databaseNName of database. default env.PGDATABASE or user
portNServer port. default env.PGPORT
connectionStringNConnection string. e.g. postgres://user:password@host:5432/database
sslNfalsePassed directly to node.TLSSocket, supports all tls.connect options
statement_timeoutN0Number of milliseconds before a statement in query will time out, default is no timeout
query_timeoutN0The number of milliseconds before a query call will timeout, the default is no timeout
application_nameNThe name of the application that created this Client instance
connectionTimeoutMillisN0Number of milliseconds to wait for connection, default is no timeout
idle_in_transaction_session_timeoutN0Number of milliseconds before terminating any session with an open idle transaction, default is no timeout