* Executes the query, returning the first result or null
()
| 2649 | * Executes the query, returning the first result or null |
| 2650 | */ |
| 2651 | async getSingleResult(): Promise<Loaded<Entity, Hint, Fields> | null> { |
| 2652 | if (!this.#state.finalized) { |
| 2653 | this.limit(1); |
| 2654 | } |
| 2655 | |
| 2656 | const [res] = await this.getResultList(1); |
| 2657 | return res || null; |
| 2658 | } |
| 2659 | |
| 2660 | /** |
| 2661 | * Executes count query (without offset and limit), returning total count of results |