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

Method getSelectAliases

packages/sql/src/query/QueryBuilder.ts:1791–1805  ·  view source on GitHub ↗

Collect custom aliases from select fields (stored as 'resolved as alias' strings by select()).

()

Source from the content-addressed store, hash-verified

1789
1790 /** Collect custom aliases from select fields (stored as 'resolved as alias' strings by select()). */
1791 private getSelectAliases(): Set<string> {
1792 const aliases = new Set<string>();
1793
1794 for (const field of this.#state.fields ?? []) {
1795 if (typeof field === 'string') {
1796 const m = FIELD_ALIAS_RE.exec(field);
1797
1798 if (m) {
1799 aliases.add(m[2]);
1800 }
1801 }
1802 }
1803
1804 return aliases;
1805 }
1806
1807 /**
1808 * Adds a GROUP BY clause to the query.

Callers 1

processOrderByMethod · 0.95

Calls 1

addMethod · 0.80

Tested by

no test coverage detected