Skip to content

Commit

Permalink
savepoint backwards compat.
Browse files Browse the repository at this point in the history
  • Loading branch information
igalklebanov committed Oct 24, 2024
1 parent ae5cb1e commit 6ce4133
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/parser/savepoint-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@ import { RawNode } from '../operation-node/raw-node.js'
export type RollbackToSavepoint<
S extends string[],
SN extends S[number],
> = S extends [...infer L extends string[], infer R]
> = S extends [...infer L, infer R]
? R extends SN
? S
: RollbackToSavepoint<L, SN>
: L extends string[]
? RollbackToSavepoint<L, SN>
: never
: never

export type ReleaseSavepoint<
S extends string[],
SN extends S[number],
> = S extends [...infer L extends string[], infer R]
> = S extends [...infer L, infer R]
? R extends SN
? L
: ReleaseSavepoint<L, SN>
: L extends string[]
? ReleaseSavepoint<L, SN>
: never
: never

export function parseSavepointCommand(
Expand Down

0 comments on commit 6ce4133

Please sign in to comment.