| 10 | // SQLWrapper runtime implementation is defined in 'sql/sql.ts' |
| 11 | } |
| 12 | export class Subquery< |
| 13 | TAlias extends string = string, |
| 14 | TSelectedFields extends Record<string, unknown> = Record<string, unknown>, |
| 15 | > implements SQLWrapper { |
| 16 | static readonly [entityKind]: string = 'Subquery'; |
| 17 | |
| 18 | declare _: { |
| 19 | brand: 'Subquery'; |
| 20 | sql: SQL; |
| 21 | selectedFields: TSelectedFields; |
| 22 | alias: TAlias; |
| 23 | isWith: boolean; |
| 24 | usedTables?: string[]; |
| 25 | }; |
| 26 | |
| 27 | constructor(sql: SQL, fields: TSelectedFields, alias: string, isWith = false, usedTables: string[] = []) { |
| 28 | this._ = { |
| 29 | brand: 'Subquery', |
| 30 | sql, |
| 31 | selectedFields: fields as TSelectedFields, |
| 32 | alias: alias as TAlias, |
| 33 | isWith, |
| 34 | usedTables, |
| 35 | }; |
| 36 | } |
| 37 | |
| 38 | // getSQL(): SQL<unknown> { |
| 39 | // return new SQL([this]); |
| 40 | // } |
| 41 | } |
| 42 | |
| 43 | export class WithSubquery< |
| 44 | TAlias extends string = string, |
nothing calls this directly
no outgoing calls
no test coverage detected