( queries: T, )
| 197 | } |
| 198 | |
| 199 | async batch<U extends BatchItem<class="st">'pg'>, T extends Readonly<[U, ...U[]]>>( |
| 200 | queries: T, |
| 201 | ) { |
| 202 | const preparedQueries: PreparedQuery[] = []; |
| 203 | const builtQueries: NeonQueryPromise<any, true>[] = []; |
| 204 | for (const query of queries) { |
| 205 | const preparedQuery = query._prepare(); |
| 206 | const builtQuery = preparedQuery.getQuery(); |
| 207 | preparedQueries.push(preparedQuery); |
| 208 | builtQueries.push( |
| 209 | this.clientQuery(builtQuery.sql, builtQuery.params, { |
| 210 | fullResults: true, |
| 211 | arrayMode: preparedQuery.isResponseInArrayMode(), |
| 212 | }), |
| 213 | ); |
| 214 | } |
| 215 | |
| 216 | const batchResults = await this.client.transaction(builtQueries, queryConfig); |
| 217 | |
| 218 | return batchResults.map((result, i) => preparedQueries[i]!.mapResult(result, true)) as any; |
| 219 | } |
| 220 | |
| 221 | class="cm">// change return type to QueryRows<true> |
| 222 | async query(query: string, params: unknown[]): Promise<FullQueryResults<true>> { |
nothing calls this directly
no test coverage detected