diff --git a/src/query-builder/merge-query-builder.ts b/src/query-builder/merge-query-builder.ts index 4792d234f..b469816b8 100644 --- a/src/query-builder/merge-query-builder.ts +++ b/src/query-builder/merge-query-builder.ts @@ -703,7 +703,7 @@ export class WheneableMergeQueryBuilder< ) } - compile(): CompiledQuery { + compile(): CompiledQuery { return this.#props.executor.compileQuery( this.toOperationNode(), this.#props.queryId, diff --git a/test/typings/test-d/infer-result.test-d.ts b/test/typings/test-d/infer-result.test-d.ts index 088a191b9..5c9b50672 100644 --- a/test/typings/test-d/infer-result.test-d.ts +++ b/test/typings/test-d/infer-result.test-d.ts @@ -6,6 +6,7 @@ import { InferResult, InsertResult, Kysely, + MergeResult, Selectable, UpdateResult, } from '..' @@ -128,3 +129,16 @@ function testInferResultDeleteQuery(db: Kysely) { expectType>>(true) expectType>>(true) } + +function testInferResultMergeQuery(db: Kysely) { + const query0 = db + .mergeInto('person') + .using('pet', 'pet.owner_id', 'person.id') + .whenMatched() + .thenDelete() + const compiledQuery0 = query0.compile() + + type Expected0 = MergeResult[] + expectType>>(true) + expectType>>(true) +}