This repository has been archived on 2020-08-13. You can view files and clone it, but cannot push or open issues or pull requests.
requestor/lib/KnexInterface.ts
Timo Hocker 3716e80674 fixes
2020-04-17 11:27:56 +02:00

32 lines
1.2 KiB
TypeScript

/* eslint-disable @typescript-eslint/naming-convention */
interface KnexQuery {
insert(data: object): Promise<Array<unknown>>;
update(data: object): Promise<unknown>;
select(...columns: Array<string>): Promise<Array<object>>;
delete(): Promise<unknown>;
where(filter: object): KnexQuery;
whereNot(filter: object): KnexQuery;
whereIn(filter: object): KnexQuery;
whereNotIn(filter: object): KnexQuery;
whereNull(filter: object): KnexQuery;
whereNotNull(filter: object): KnexQuery;
whereExists(filter: object): KnexQuery;
whereNotExists(filter: object): KnexQuery;
whereBetween(filter: object): KnexQuery;
whereNotBetween(filter: object): KnexQuery;
join(table: string, col: string, on: string): KnexQuery;
leftJoin(table: string, col: string, on: string): KnexQuery;
rightJoin(table: string, col: string, on: string): KnexQuery;
leftOuterJoin(table: string, col: string, on: string): KnexQuery;
rightOuterJoin(table: string, col: string, on: string): KnexQuery;
fullOuterJoin(table: string, col: string, on: string): KnexQuery;
returning(column: string | Array<string>): KnexQuery;
}
type Knex = {
(table: string): KnexQuery;
}
export { Knex, KnexQuery };