UNPKG

kysely-mapper

Version:

Flexible Kysely-based utility for mapping between tables and objects

18 lines 1.29 kB
import { ComparisonOperatorExpression, Kysely, OperandValueExpressionOrList, ReferenceExpression, WhereInterface } from 'kysely'; import { SelectableColumnTuple } from './type-utils.js'; import { QueryFilter } from './query-filter.js'; type AnyWhereInterface = WhereInterface<any, any>; /** * Returns a query builder that constrains the provided query builder * according to the provided query filter or binary operation. * @param base The Kysely mapper that is used to create references. * @param qb The query builder to constrain. * @param filterOrLHS The query filter or left-hand side of a binary operation. * @param op The operator of a binary operation. * @param rhs The right-hand side of a binary operation. * @returns A query builder constrained for the provided query filter * or binary operation. */ export declare function applyQueryFilter<DB, TB extends keyof DB & string, KeyColumns extends Readonly<SelectableColumnTuple<DB[TB]>> | Readonly<[]>, QB extends AnyWhereInterface, RE extends ReferenceExpression<DB, TB>>(db: Kysely<DB>, qb: QB, keyColumns: KeyColumns, filterOrLHS: QueryFilter<DB, TB, KeyColumns, RE> | RE, op?: ComparisonOperatorExpression, rhs?: OperandValueExpressionOrList<DB, TB, RE>): QB; export {}; //# sourceMappingURL=apply-query-filter.d.ts.map