Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
igalklebanov committed Oct 24, 2024
1 parent ea44608 commit 9cdad5b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/kysely.ts
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,9 @@ export class ControlledTransaction<
*/
rollbackToSavepoint<SN extends S[number]>(
savepointName: SN,
): Command<ControlledTransaction<DB, RollbackToSavepoint<S, SN>>> {
): RollbackToSavepoint<S, SN> extends string[]
? Command<ControlledTransaction<DB, RollbackToSavepoint<S, SN>>>
: never {
this.#assertNotCommittedOrRolledBack()

return new Command(async () => {
Expand All @@ -916,7 +918,7 @@ export class ControlledTransaction<
)

return new ControlledTransaction({ ...this.#props })
})
}) as any
}

/**
Expand Down Expand Up @@ -947,7 +949,9 @@ export class ControlledTransaction<
*/
releaseSavepoint<SN extends S[number]>(
savepointName: SN,
): Command<ControlledTransaction<DB, ReleaseSavepoint<S, SN>>> {
): ReleaseSavepoint<S, SN> extends string[]
? Command<ControlledTransaction<DB, ReleaseSavepoint<S, SN>>>
: never {
this.#assertNotCommittedOrRolledBack()

return new Command(async () => {
Expand All @@ -958,7 +962,7 @@ export class ControlledTransaction<
)

return new ControlledTransaction({ ...this.#props })
})
}) as any
}

override withPlugin(plugin: KyselyPlugin): ControlledTransaction<DB, S> {
Expand Down

0 comments on commit 9cdad5b

Please sign in to comment.