Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InferResult should output plural. #1064

Merged
merged 4 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: tests

on:
push:
branches: [master]
branches: [master, v*]
pull_request:
branches: [master]
branches: [master, v*]

jobs:
node:
Expand Down
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)
}