diff --git a/src/parser/savepoint-parser.ts b/src/parser/savepoint-parser.ts index 8163bb935..c5336377e 100644 --- a/src/parser/savepoint-parser.ts +++ b/src/parser/savepoint-parser.ts @@ -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 extends string[] + ? RollbackToSavepoint + : 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 extends string[] + ? ReleaseSavepoint + : never : never export function parseSavepointCommand(