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

Method withSubQuery

packages/sql/src/query/QueryBuilder.ts:1507–1517  ·  view source on GitHub ↗
(subQuery: RawQueryFragment | NativeQueryBuilder, alias: string)

Source from the content-addressed store, hash-verified

1505 }
1506
1507 withSubQuery(subQuery: RawQueryFragment | NativeQueryBuilder, alias: string): this {
1508 this.ensureNotFinalized();
1509
1510 if (isRaw(subQuery)) {
1511 this.#state.subQueries[alias] = this.platform.formatQuery(subQuery.sql, subQuery.params);
1512 } else {
1513 this.#state.subQueries[alias] = subQuery.toString();
1514 }
1515
1516 return this;
1517 }
1518
1519 /**
1520 * Adds a WHERE clause to the query using an object condition.

Callers

nothing calls this directly

Calls 4

ensureNotFinalizedMethod · 0.95
isRawFunction · 0.90
formatQueryMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected