| 205 | } |
| 206 | |
| 207 | async all(placeholderValues?: Record<string, unknown>): Promise<T['all']> { |
| 208 | const { fields, query, logger, stmt, customResultMapper } = this; |
| 209 | if (!fields && !customResultMapper) { |
| 210 | const params = fillPlaceholders(query.params, placeholderValues ?? {}); |
| 211 | logger.logQuery(query.sql, params); |
| 212 | return await this.queryWithCache(query.sql, params, async () => { |
| 213 | return stmt.bind(...params).all().then(({ results }) => this.mapAllResult(results!)); |
| 214 | }); |
| 215 | } |
| 216 | |
| 217 | const rows = await this.values(placeholderValues); |
| 218 | |
| 219 | return this.mapAllResult(rows); |
| 220 | } |
| 221 | |
| 222 | override mapAllResult(rows: unknown, isFromBatch?: boolean): unknown { |
| 223 | if (isFromBatch) { |