Add new aggregation types to query type

This commit is contained in:
rijkvanzanten
2021-05-25 14:30:45 -04:00
parent 51bc0a8c9f
commit 2f6a90ee14

View File

@@ -10,6 +10,8 @@ export type Query = {
meta?: Meta[];
search?: string;
export?: 'json' | 'csv' | 'xml';
group?: string[];
aggregate?: Aggregate;
deep?: Record<string, Query>;
};
@@ -22,6 +24,27 @@ export type Filter = {
[keyOrOperator: string]: Filter | any;
};
/**
* Aggregate operation. Contains column name, and the field alias it should be returned as
*/
export type Aggregate = {
avg?: {
[column: string]: string;
};
min?: {
[column: string]: string;
};
max?: {
[column: string]: string;
};
count?: {
[column: string]: string;
};
sum?: {
[column: string]: string;
};
};
export type FilterOperator =
| 'eq'
| 'neq'