pg-query-config
Version:
Query Builder for PostgreSQL
21 lines (20 loc) • 701 B
TypeScript
declare type QueryParams<T extends {
[key in string]: any;
}> = {
schema?: string;
table: string;
columns?: Array<keyof T>;
limit?: number;
offset?: number;
};
declare type WhereFunction<T> = (valueRefSet: Set<T>, args: T[]) => string;
declare type WhereCondition<T> = {
[P in keyof T]?: WhereCondition<T[P]> | T[P] | WhereFunction<T[P]> | Array<T[P]>;
};
declare type OrderCondition<T> = {
[P in keyof T]?: T[P] extends object ? OrderCondition<T[P]> : 'ASC' | 'DESC';
};
declare function isNullableCondition(fn: Function): fn is Function & {
nullableCondition: string;
};
export { QueryParams, WhereFunction, WhereCondition, OrderCondition, isNullableCondition };