#5-intelligent-groups #23
2 changed files with 7 additions and 3 deletions
|
@ -41,14 +41,16 @@ export async function executeQuery(req: Request, res: Response): Promise<any> {
|
||||||
let [rows, total] = await DynamicQueryBuilder.buildQuery(query, offset, count).getManyAndCount();
|
let [rows, total] = await DynamicQueryBuilder.buildQuery(query, offset, count).getManyAndCount();
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
|
stats: "success",
|
||||||
rows: rows,
|
rows: rows,
|
||||||
total: total,
|
total: total,
|
||||||
offset: offset,
|
offset: offset,
|
||||||
count: count,
|
count: count,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
res.status(500).send({
|
res.json({
|
||||||
json: error.sql,
|
stats: "error",
|
||||||
|
sql: error.sql,
|
||||||
code: error.code,
|
code: error.code,
|
||||||
msg: error.sqlMessage,
|
msg: error.sqlMessage,
|
||||||
});
|
});
|
||||||
|
|
|
@ -43,7 +43,9 @@ export type WhereOperation =
|
||||||
| "notNull" // Is not null
|
| "notNull" // Is not null
|
||||||
| "between" // Is between
|
| "between" // Is between
|
||||||
| "startsWith" // Starts with
|
| "startsWith" // Starts with
|
||||||
| "endsWith"; // Ends with
|
| "endsWith" // Ends with
|
||||||
|
| "timespanEq"; // Date before x years (YYYY-01-01 <bis> YYYY-12-31)
|
||||||
|
// TODO: age between | age equals | age greater | age smaller
|
||||||
|
|
||||||
export type OrderByStructure = {
|
export type OrderByStructure = {
|
||||||
column: string;
|
column: string;
|
||||||
|
|
Loading…
Reference in a new issue