Skip to content

Commit

Permalink
chore: add Kysely options
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicGBauer committed Feb 27, 2024
1 parent 92aa297 commit 8167f60
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
12 changes: 10 additions & 2 deletions packages/kysely-driver/src/index.ts
Original file line number Diff line number Diff line change
@@ -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 };
7 changes: 4 additions & 3 deletions packages/kysely-driver/src/sqlite/db.ts
Original file line number Diff line number Diff line change
@@ -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 = <T>(db: AbstractPowerSyncDatabase) => {
export const wrapPowerSyncWithKysely = <T>(db: AbstractPowerSyncDatabase, options?: KyselyConfig) => {
return new Kysely<T>({
dialect: new PowerSyncDialect({
db
})
}),
...options
});
};

0 comments on commit 8167f60

Please sign in to comment.