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) }