UNPKG

typeorm-linq-repository

Version:

Wraps TypeORM repository pattern and QueryBuilder using fluent, LINQ-style queries.

22 lines (21 loc) 1.05 kB
import { EntityBase } from "../../types/EntityBase"; import { Nullable } from "../../types/Nullable"; import { IComparableQuery } from "./IComparableQuery"; import { IQueryBase } from "./IQueryBase"; import { ISelectQuery } from "./ISelectQuery"; /** * Allows .where() to use the last joined entity's alias. */ export interface IJoinedQuery<T extends EntityBase, R extends Nullable<T> | T[], P = T> extends IQueryBase<T, R, P> { /** * Selects a property from the last joined entity to select while performing an inner query. * @param propertySelector Property selection lambda for the property to select. */ select(propertySelector: (obj: P) => any): ISelectQuery<T, R, P>; /** * Filters the query with a conditional statement based on the last joined entity's type. * @type {S} The type of the joined navigation property. * @param propertySelector Property selection lambda for property to compare. */ where<S extends EntityBase>(propertySelector: (obj: P) => S): IComparableQuery<T, R, P>; }