Skip to Content

Last Updated: 3/9/2026


kysely

  • KyselyConfig

Interface KyselyConfig

interface KyselyConfig {
    dialect: Dialect;
    log?: LogConfig;
    plugins?: KyselyPlugin[];
}

Index

Properties

dialect log? plugins?

Properties

Readonlydialect

dialect: Dialect

Optional Readonlylog

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

Setting up built-in logging for preferred log levels:

import * as Sqlite from 'better-sqlite3' import { Kysely, SqliteDialect } from 'kysely' import type { Database } from 'type-editor' // imaginary module const db = new Kysely< Database>({ dialect: new SqliteDialect({ database: new Sqlite(':memory:'), }), log: ['query', 'error']})

Setting up custom logging:

import * as Sqlite from 'better-sqlite3' import { Kysely, SqliteDialect } from 'kysely' import type { Database } from 'type-editor' // imaginary module const db = new Kysely< Database>({ dialect: new SqliteDialect({ database: new Sqlite(':memory:'), }), log(event): void { if (event. level === 'query') { console. log(event. query. sql) console. log(event. query. parameters) } }})

Optional Readonlyplugins

plugins?: KyselyPlugin[]

Settings

Member Visibility

On This Page

Properties

dialectlog

plugins