Class PostgresDialect

PostgreSQL dialect that uses the pg library.

The constructor takes an instance of PostgresDialectConfig.

importPool } from 'pg'

new PostgresDialect({
pool: new Pool({
database: 'some_db',
host: 'localhost',
})
})

If you want the pool to only be created once it's first used, pool can be a function:

importPool } from 'pg'

new PostgresDialect({
pool: async () => new Pool({
database: 'some_db',
host: 'localhost',
})
})

Hierarchy

  • PostgresDialect

Implements

Constructors

Methods

Generated using TypeDoc