Skip to content

Commit a3d18c9

Browse files
committed
best bench results.
1 parent 0158214 commit a3d18c9

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

src/query-builder/select-query-builder.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
Nullable,
3131
ShallowRecord,
3232
Simplify,
33+
SimplifySingleResult,
3334
SqlBool,
3435
} from '../util/type-utils.js'
3536
import {
@@ -2118,19 +2119,23 @@ export interface SelectQueryBuilder<DB, TB extends keyof DB, O>
21182119

21192120
compile(): CompiledQuery<Simplify<O>>
21202121

2121-
execute(): Promise<Simplify<O>[]>
2122+
execute(
2123+
options?: ExecuteOptions,
2124+
): Promise<NonNullable<SimplifySingleResult<O>>[]>
21222125

2123-
executeTakeFirst(): Promise<Simplify<O> | undefined>
2126+
executeTakeFirst(
2127+
options?: ExecuteOptions,
2128+
): Promise<SimplifySingleResult<O> | undefined>
21242129

21252130
executeTakeFirstOrThrow(
21262131
errorConstructor?: NoResultErrorConstructor | ((node: QueryNode) => Error),
2127-
): Promise<Simplify<O>>
2132+
): Promise<SimplifySingleResult<O>>
21282133

21292134
executeTakeFirstOrThrow(
21302135
options?: ExecuteOptions & {
21312136
errorConstructor?: NoResultErrorConstructor | ((node: QueryNode) => Error)
21322137
},
2133-
): Promise<O>
2138+
): Promise<SimplifySingleResult<O>>
21342139

21352140
stream(chunkSize?: number): AsyncIterableIterator<O>
21362141

src/util/executable.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import { QueryNode } from '../operation-node/query-node.js'
22
import { NoResultErrorConstructor } from '../query-builder/no-result-error.js'
33
import { ExecuteQueryOptions } from '../query-executor/query-executor.js'
4-
import { Simplify, SimplifySingleResult } from './type-utils.js'
4+
import { SimplifySingleResult } from './type-utils.js'
55

66
export interface Executable<O> {
77
/**
88
* Executes the query and returns an array of rows.
99
*
1010
* Also see the {@link executeTakeFirst} and {@link executeTakeFirstOrThrow} methods.
1111
*/
12-
execute(options?: ExecuteOptions): Promise<SimplifySingleResult<O>[]>
12+
execute(
13+
options?: ExecuteOptions,
14+
): Promise<NonNullable<SimplifySingleResult<O>>[]>
1315

1416
/**
1517
* Executes the query and returns the first result or undefined if

0 commit comments

Comments
 (0)