32 lines
1.2 KiB
TypeScript
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 };
|