Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/kysely_postgrs_js_dialect/mod.ts>kysely.PostgresDialect

Kysely dialect for PostgreSQL using the Postgres.js client.
Latest
class kysely.PostgresDialect
implements Dialect
import { kysely } from "https://deno.land/x/kysely_postgrs_js_dialect@v0.27.4/mod.ts";
const { PostgresDialect } = kysely;

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',
  })
})

Constructors

new
PostgresDialect(config: PostgresDialectConfig)

Methods

Creates an adapter for the dialect.

Creates a driver for the dialect.

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.

Creates a query compiler for the dialect.