Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

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',
  })
})
class PostgresDialect implements Dialect {
constructor(config: PostgresDialectConfig);
createAdapter(): DialectAdapter;
createDriver(): Driver;
createIntrospector(db: Kysely<any>): DatabaseIntrospector;
createQueryCompiler(): QueryCompiler;
}

§Implements

§Constructors

§
new PostgresDialect(config: PostgresDialectConfig)
[src]

§Methods

§
createAdapter(): DialectAdapter
[src]

Creates an adapter for the dialect.

§
createDriver(): Driver
[src]

Creates a driver for the dialect.

§
createIntrospector(db: Kysely<any>): DatabaseIntrospector
[src]

Creates a database introspector that can be used to get database metadata such as the table names and column names of those tables.

db never has any plugins installed. It's created using Kysely.withoutPlugins.

§
createQueryCompiler(): QueryCompiler
[src]

Creates a query compiler for the dialect.