Skip to content

Commit

Permalink
short circuit get-kysely if exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
igalklebanov committed Jun 28, 2024
1 parent a44ac2b commit af1e07c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/kysely/get-kysely.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ export async function getKysely<DB = any>(
config: ResolvedKyselyCTLConfig,
debug = false,
): Promise<Kysely<DB>> {
const { kysely } = config

if (kysely) {
return kysely
}

const dialect = await getDialect(config)

return new Kysely<DB>({
Expand Down

0 comments on commit af1e07c

Please sign in to comment.