mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 16:36:00 +00:00
SYNC: Merge pull request #5 from dbgate/feature/firestore
This commit is contained in:
89
packages/types/query.d.ts
vendored
89
packages/types/query.d.ts
vendored
@@ -15,3 +15,92 @@ export interface QueryResult {
|
||||
columns?: QueryResultColumn[];
|
||||
rowsAffected?: number;
|
||||
}
|
||||
|
||||
export type LeftOperand = {
|
||||
exprType: 'placeholder' | 'column';
|
||||
columnName?: string;
|
||||
};
|
||||
|
||||
export type RightOperand = {
|
||||
exprType: 'value';
|
||||
value: any;
|
||||
};
|
||||
|
||||
export type BinaryCondition = {
|
||||
conditionType: 'binary';
|
||||
operator: '=' | '!=' | '<>' | '<' | '<=' | '>' | '>=';
|
||||
left: LeftOperand;
|
||||
right: RightOperand;
|
||||
};
|
||||
|
||||
export type AndCondition = {
|
||||
conditionType: 'and';
|
||||
conditions: FilterCondition[];
|
||||
};
|
||||
|
||||
export type OrCondition = {
|
||||
conditionType: 'or';
|
||||
conditions: FilterCondition[];
|
||||
};
|
||||
|
||||
export type NullCondition = {
|
||||
conditionType: 'isNull' | 'isNotNull';
|
||||
expr: LeftOperand;
|
||||
};
|
||||
|
||||
export type NotCondition = {
|
||||
conditionType: 'not';
|
||||
condition: FilterCondition;
|
||||
};
|
||||
|
||||
export type LikeCondition = {
|
||||
conditionType: 'like';
|
||||
left: LeftOperand;
|
||||
right: RightOperand;
|
||||
};
|
||||
|
||||
export type PredicateCondition = {
|
||||
conditionType: 'specificPredicate';
|
||||
predicate: 'exists' | 'notExists' | 'emptyArray' | 'notEmptyArray';
|
||||
expr: LeftOperand;
|
||||
};
|
||||
|
||||
export type InCondition = {
|
||||
conditionType: 'in';
|
||||
expr: LeftOperand;
|
||||
values: any[];
|
||||
};
|
||||
|
||||
export type FilterCondition =
|
||||
| BinaryCondition
|
||||
| AndCondition
|
||||
| OrCondition
|
||||
| NullCondition
|
||||
| NotCondition
|
||||
| LikeCondition
|
||||
| PredicateCondition
|
||||
| InCondition;
|
||||
|
||||
export type SortItem = {
|
||||
columnName: string;
|
||||
direction?: 'ASC' | 'DESC';
|
||||
};
|
||||
|
||||
export type AggregateColumn = {
|
||||
aggregateFunction: 'count' | 'sum' | 'avg' | 'min' | 'max';
|
||||
columnArgument?: string;
|
||||
alias: string;
|
||||
};
|
||||
|
||||
export type CollectionAggregate = {
|
||||
condition?: FilterCondition;
|
||||
groupByColumns: string[];
|
||||
aggregateColumns: AggregateColumn[];
|
||||
};
|
||||
|
||||
export type FullQueryOptions = {
|
||||
condition?: FilterCondition;
|
||||
sort?: SortItem[];
|
||||
limit?: number;
|
||||
skip?: number;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user