-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
DominicGBauer
committed
Feb 27, 2024
1 parent
92aa297
commit 8167f60
Showing
2 changed files
with
14 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}); | ||
}; |