refql
Version:
A Node.js and Deno library for composing and running SQL queries.
17 lines (16 loc) • 1.01 kB
TypeScript
import { RefInput, RefNodeInput, RelType } from "../common/types";
import { Table } from "../Table";
import PropType from "./PropType";
interface RefProp<As extends string = any, TableId extends string = any, Rel extends RelType = any, Nullable extends boolean = any> extends PropType<As> {
rel: Rel;
tableId: TableId;
refInput: Rel extends "BelongsToMany" ? RefInput : RefNodeInput;
child: Table;
isNullable: Nullable;
nullable(): RefProp<As, TableId, Rel, true>;
}
declare function RefProp<As extends string, TableId extends string, Rel extends RelType, Nullable extends boolean>(as: As, tableId: TableId, rel: Rel, refInput: Rel extends "BelongsToMany" ? RefInput : RefNodeInput, isNullable: Nullable): RefProp<As, TableId, Rel, Nullable>;
declare namespace RefProp {
var isRefProp: <As extends string = any, TableId extends string = any, Rel extends RelType = any, Nullable extends boolean = false>(x: any) => x is RefProp<As, TableId, Rel, Nullable>;
}
export default RefProp;