Skip to content
Functionplugin-kyselyv0.9.0

nodeSqlite

Wraps a node:sqlite database for Kysely's SqliteDialect.

Kysely passes a query's parameters as one array and reads a reader flag off each statement. node:sqlite takes the parameters spread out, and its statements don't carry that flag. This wrapper spreads the array and sets the flag from the statement's columns.

nodeSqlite(database: DatabaseSync): SqliteDatabase
import { DatabaseSync } from 'node:sqlite';
import { SqliteDialect } from 'kysely';

seedcord.attach('db', Kysely, {
    dialect: () => new SqliteDialect({ database: nodeSqlite(new DatabaseSync('bot.db')) }),
    path: './services',
    migrations: { path: './migrations' }
});

database

database: DatabaseSync