From 8167f6083974645aa05fae523193c7514fc6a9dd Mon Sep 17 00:00:00 2001 From: DominicGBauer Date: Tue, 27 Feb 2024 10:47:11 +0200 Subject: [PATCH] chore: add Kysely options --- packages/kysely-driver/src/index.ts | 12 ++++++++++-- packages/kysely-driver/src/sqlite/db.ts | 7 ++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/kysely-driver/src/index.ts b/packages/kysely-driver/src/index.ts index b6ef5364..6c84390e 100644 --- a/packages/kysely-driver/src/index.ts +++ b/packages/kysely-driver/src/index.ts @@ -1,4 +1,12 @@ import { wrapPowerSyncWithKysely } from './sqlite/db'; -import { Kysely, ColumnType, Insertable, Selectable, Updateable, sql } from 'kysely'; +import { + type ColumnType, + type Insertable, + type Selectable, + type Updateable, + type KyselyConfig, + Kysely, + sql +} from 'kysely'; -export { wrapPowerSyncWithKysely, Kysely, ColumnType, Insertable, Selectable, Updateable, sql }; +export { ColumnType, Insertable, Selectable, Updateable, KyselyConfig, sql, Kysely, wrapPowerSyncWithKysely }; diff --git a/packages/kysely-driver/src/sqlite/db.ts b/packages/kysely-driver/src/sqlite/db.ts index 6796c3c8..0871d120 100644 --- a/packages/kysely-driver/src/sqlite/db.ts +++ b/packages/kysely-driver/src/sqlite/db.ts @@ -1,11 +1,12 @@ import { PowerSyncDialect } from './sqlite-dialect'; -import { Kysely } from 'kysely'; +import { Kysely, type KyselyConfig } from 'kysely'; import { type AbstractPowerSyncDatabase } from '@journeyapps/powersync-sdk-common'; -export const wrapPowerSyncWithKysely = (db: AbstractPowerSyncDatabase) => { +export const wrapPowerSyncWithKysely = (db: AbstractPowerSyncDatabase, options?: KyselyConfig) => { return new Kysely({ dialect: new PowerSyncDialect({ db - }) + }), + ...options }); };