From a47b9c23e1e0688d65617120f7c2b155461c4eb6 Mon Sep 17 00:00:00 2001 From: Igal Klebanov Date: Sun, 7 Jul 2024 23:02:15 +0300 Subject: [PATCH] `InferResult` should output plural. (#1064) --- src/util/infer-result.ts | 2 +- test/typings/test-d/infer-result.test-d.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/infer-result.ts b/src/util/infer-result.ts index d972bbe9d..b616e3386 100644 --- a/src/util/infer-result.ts +++ b/src/util/infer-result.ts @@ -56,5 +56,5 @@ type ResolveResult = O extends | UpdateResult | DeleteResult | MergeResult - ? O + ? O[] : Simplify[] diff --git a/test/typings/test-d/infer-result.test-d.ts b/test/typings/test-d/infer-result.test-d.ts index 4ec7ed3a0..94fe12515 100644 --- a/test/typings/test-d/infer-result.test-d.ts +++ b/test/typings/test-d/infer-result.test-d.ts @@ -47,7 +47,7 @@ function testInferResultInsertQuery(db: Kysely) { }) const compiledQuery0 = query0.compile() - type Expected0 = InsertResult + type Expected0 = InsertResult[] expectType>>(true) expectType>>(true) @@ -74,7 +74,7 @@ function testInferResultUpdateQuery(db: Kysely) { .where('pet.id', '=', '1') const compiledQuery0 = query0.compile() - type Expected0 = UpdateResult + type Expected0 = UpdateResult[] expectType>>(true) expectType>>(true) @@ -111,7 +111,7 @@ function testInferResultDeleteQuery(db: Kysely) { const query0 = db.deleteFrom('pet').where('id', '=', '1') const compiledQuery0 = query0.compile() - type Expected0 = DeleteResult + type Expected0 = DeleteResult[] expectType>>(true) expectType>>(true) @@ -138,7 +138,7 @@ function testInferResultMergeQuery(db: Kysely) { .thenDelete() const compiledQuery0 = query0.compile() - type Expected0 = MergeResult + type Expected0 = MergeResult[] expectType>>(true) expectType>>(true) }