()
| 2311 | } |
| 2312 | |
| 2313 | toQuery(): { sql: string; params: readonly unknown[] } { |
| 2314 | if (this.#state.unionQuery) { |
| 2315 | return this.#state.unionQuery; |
| 2316 | } |
| 2317 | |
| 2318 | if (this.#query?.sql) { |
| 2319 | return { sql: this.#query.sql, params: this.#query.params! }; |
| 2320 | } |
| 2321 | |
| 2322 | const query = this.getNativeQuery().compile(); |
| 2323 | this.#query!.sql = query.sql; |
| 2324 | this.#query!.params = query.params; |
| 2325 | |
| 2326 | return { sql: this.#query!.sql, params: this.#query!.params }; |
| 2327 | } |
| 2328 | |
| 2329 | /** |
| 2330 | * Returns the list of all parameters for this query. |
no test coverage detected