Skip to main content
Module

x/kysely_deno_postgres_dialect/mod.ts>kysely.KyselyConfig

Kysely dialect for PostgreSQL using the deno-postgres client.
Go to Latest
interface kysely.KyselyConfig
import { type kysely } from "https://deno.land/x/kysely_deno_postgres_dialect@v0.27.0/mod.ts";
const { KyselyConfig } = kysely;

Properties

readonly
dialect: Dialect
readonly
optional
plugins: KyselyPlugin[]
readonly
optional
log: LogConfig

A list of log levels to log or a custom logger function.

Currently there's only two levels: query and error. This will be expanded based on user feedback later.

Examples

const db = new Kysely<Database>({
  dialect: new PostgresDialect(postgresConfig),
  log: ['query', 'error']
})
const db = new Kysely<Database>({
  dialect: new PostgresDialect(postgresConfig),
  log(event): void {
    if (event.level === 'query') {
      console.log(event.query.sql)
      console.log(event.query.parameters)
    }
  }
})