From 6ce41338a9693b22d43ee4ad13c6d687620d72da Mon Sep 17 00:00:00 2001 From: igalklebanov Date: Thu, 24 Oct 2024 15:44:27 +0300 Subject: [PATCH] savepoint backwards compat. --- src/parser/savepoint-parser.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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(