* Adds fields to an existing SELECT query.
(
fields: F,
)
| 809 | * Adds fields to an existing SELECT query. |
| 810 | */ |
| 811 | addSelect<const F extends Field<Entity, RootAlias, Context> | readonly Field<Entity, RootAlias, Context>[]>( |
| 812 | fields: F, |
| 813 | ): SelectQueryBuilder< |
| 814 | Entity, |
| 815 | RootAlias, |
| 816 | Hint, |
| 817 | Context, |
| 818 | RawAliases | ExtractRawAliases<F extends readonly unknown[] ? F : [F]>, |
| 819 | Fields | ExtractRootFields<F extends readonly (infer U)[] ? U & string : F & string, RootAlias, Context>, |
| 820 | CTEs |
| 821 | > { |
| 822 | this.ensureNotFinalized(); |
| 823 | |
| 824 | if (this.#state.type && this.#state.type !== QueryType.SELECT) { |
| 825 | return this as any; |
| 826 | } |
| 827 | |
| 828 | return this.select([...Utils.asArray(this.#state.fields), ...Utils.asArray(fields as string)] as any) as any; |
| 829 | } |
| 830 | |
| 831 | distinct(): SelectQueryBuilder<Entity, RootAlias, Hint, Context, RawAliases, Fields, CTEs> { |
| 832 | this.ensureNotFinalized(); |
no test coverage detected