@cran/gql.jm
Version:
Cran/GraphQL Join Monster Utilities
50 lines (49 loc) • 1.08 kB
TypeScript
export declare type Direction = "asc" | "desc";
export declare type Nulls = "first" | "last";
export interface WhereAnd {
and: Array<Where>;
}
export interface WhereOr {
or: Array<Where>;
}
export interface WhereNot {
not: Where;
}
export interface WhereClause {
column: string;
op: string;
value?: unknown;
}
export declare type Where = WhereClause | WhereNot | WhereAnd | WhereOr;
interface AstBatch {
thisKey: AstColumn;
parentKey: AstColumn;
}
interface AstTable {
type: "table";
args: Record<string, unknown>;
name: string;
sqlJoin: Function;
as: string;
orderBy: Record<string, Direction>;
children: Array<Ast>;
fieldName: string;
grabMany: boolean;
where: Function;
sqlBatch: AstBatch;
}
interface AstColumn {
type: "column";
name: string;
fieldName: string;
as: string;
}
interface AstColumnDeps {
type: "columnDeps";
names: Record<string, string>;
}
interface AstNoop {
type: "noop";
}
export declare type Ast = AstTable | AstColumn | AstColumnDeps | AstNoop;
export {};