UNPKG

refql

Version:

A Node.js and Deno library for composing and running SQL queries.

27 lines (26 loc) 1.11 kB
import { RQLTag } from "."; import { Table } from "../Table"; import { InterpretedCUD, Querier, RequiredRefQLOptions, Runner, StringMap } from "../common/types"; declare const CUDSymbol: unique symbol; interface CUD<TableId extends string = any, Params = any, Output = any> { (params: {} extends Params ? Params | void : Params): Promise<Output[]>; tableId: TableId; table: Table<TableId>; params: Params; options: RequiredRefQLOptions; runner: Runner; [CUDSymbol]: true; interpret(): InterpretedCUD<Params, Output>; interpreted: InterpretedCUD<Params, Output>; compile(params: Params): [string, any[], RQLTag]; run(params: Params, querier?: Querier): Promise<Output[]>; } export declare const CUDPrototype: { [CUDSymbol]: boolean; compile: typeof compile; run: typeof run; }; declare function compile(this: CUD, params: StringMap): (string | any[] | RQLTag<any, any, any, any, any> | undefined)[]; declare function run(this: CUD, params: StringMap, querier?: Querier): Promise<any[]>; export declare const isCUD: (x: any) => x is CUD; export default CUD;