MCPcopy
hub / github.com/drizzle-team/drizzle-orm / Subquery

Class Subquery

drizzle-orm/src/subquery.ts:12–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10 // SQLWrapper runtime implementation is defined in 'sql/sql.ts'
11}
12export 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
43export class WithSubquery<
44 TAlias extends string = string,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected