Skip to content

Commit

Permalink
InferResult should output plural. (#1064)
Browse files Browse the repository at this point in the history
  • Loading branch information
igalklebanov committed Nov 2, 2024
1 parent 413a885 commit 622728b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/util/infer-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ type ResolveResult<O> = O extends
| UpdateResult
| DeleteResult
| MergeResult
? O
? O[]
: Simplify<O>[]
8 changes: 4 additions & 4 deletions test/typings/test-d/infer-result.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function testInferResultInsertQuery(db: Kysely<Database>) {
})
const compiledQuery0 = query0.compile()

type Expected0 = InsertResult
type Expected0 = InsertResult[]
expectType<Equals<Expected0, InferResult<typeof query0>>>(true)
expectType<Equals<Expected0, InferResult<typeof compiledQuery0>>>(true)

Expand All @@ -74,7 +74,7 @@ function testInferResultUpdateQuery(db: Kysely<Database>) {
.where('pet.id', '=', '1')
const compiledQuery0 = query0.compile()

type Expected0 = UpdateResult
type Expected0 = UpdateResult[]
expectType<Equals<Expected0, InferResult<typeof query0>>>(true)
expectType<Equals<Expected0, InferResult<typeof compiledQuery0>>>(true)

Expand Down Expand Up @@ -111,7 +111,7 @@ function testInferResultDeleteQuery(db: Kysely<Database>) {
const query0 = db.deleteFrom('pet').where('id', '=', '1')
const compiledQuery0 = query0.compile()

type Expected0 = DeleteResult
type Expected0 = DeleteResult[]
expectType<Equals<Expected0, InferResult<typeof query0>>>(true)
expectType<Equals<Expected0, InferResult<typeof compiledQuery0>>>(true)

Expand All @@ -138,7 +138,7 @@ function testInferResultMergeQuery(db: Kysely<Database>) {
.thenDelete()
const compiledQuery0 = query0.compile()

type Expected0 = MergeResult
type Expected0 = MergeResult[]
expectType<Equals<Expected0, InferResult<typeof query0>>>(true)
expectType<Equals<Expected0, InferResult<typeof compiledQuery0>>>(true)
}

0 comments on commit 622728b

Please sign in to comment.