MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / toQuery

Method toQuery

packages/sql/src/query/QueryBuilder.ts:2313–2327  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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.

Callers 15

getQueryMethod · 0.95
toRawMethod · 0.95
getParamsMethod · 0.95
getFormattedQueryMethod · 0.95
executeMethod · 0.95
streamMethod · 0.95
applyUnionWhereFunction · 0.80
buildUnionQueryMethod · 0.80
getQueryBaseMethod · 0.80
rawFunction · 0.80

Calls 2

getNativeQueryMethod · 0.95
compileMethod · 0.45

Tested by

no test coverage detected