diff --git a/src/db/ModelQuery.ts b/src/db/ModelQuery.ts index 7ac5da3..fad6252 100644 --- a/src/db/ModelQuery.ts +++ b/src/db/ModelQuery.ts @@ -124,7 +124,7 @@ export default class ModelQuery implements WhereFieldConsumer, sortBy: string, direction: SortDirection = 'ASC', raw: boolean = false, limit?: number): this { + public union(query: ModelQuery, sortBy: string, direction: SortDirection = 'ASC', raw: boolean = false, limit?: number, offset?: number): this { if (this.type !== QueryType.SELECT) throw new Error('Union queries are only implemented with SELECT.'); this._union = { @@ -132,6 +132,7 @@ export default class ModelQuery implements WhereFieldConsumer implements WhereFieldConsumer { +export interface WhereFieldConsumer { where(field: string, value: string | Date | ModelQuery | any, test?: WhereTest, operator?: WhereOperator): this; groupWhere(setter: (query: WhereFieldConsumer) => void, operator?: WhereOperator): this; @@ -463,4 +465,5 @@ type ModelQueryUnion = { sortBy: string, direction: SortDirection, limit?: number, + offset?: number, };