(fields: unknown)
| 1841 | fields: NestedAutoPath<Entity, RootAlias, Context, P> | readonly NestedAutoPath<Entity, RootAlias, Context, P>[], |
| 1842 | ): SelectQueryBuilder<Entity, RootAlias, Hint, Context, RawAliases, Fields, CTEs>; |
| 1843 | groupBy(fields: unknown): SelectQueryBuilder<Entity, RootAlias, Hint, Context, RawAliases, Fields, CTEs> { |
| 1844 | this.ensureNotFinalized(); |
| 1845 | this.#state.groupBy = Utils.asArray( |
| 1846 | fields as Field<Entity, RootAlias, Context> | readonly Field<Entity, RootAlias, Context>[], |
| 1847 | ).flatMap(f => { |
| 1848 | if (typeof f !== 'string') { |
| 1849 | // Normalize sql.ref('prop') to string for proper formula resolution |
| 1850 | if (isRaw(f) && f.sql === '??' && f.params.length === 1) { |
| 1851 | return this.resolveNestedPath(String(f.params[0])); |
| 1852 | } |
| 1853 | |
| 1854 | return f; |
| 1855 | } |
| 1856 | return this.resolveNestedPath(f); |
| 1857 | }) as any; |
| 1858 | |
| 1859 | return this as SelectQueryBuilder<Entity, RootAlias, Hint, Context, RawAliases, Fields, CTEs>; |
| 1860 | } |
| 1861 | |
| 1862 | /** |
| 1863 | * Adds a HAVING clause to the query, typically used with GROUP BY. |
nothing calls this directly
no test coverage detected