state pass

This commit is contained in:
Julian Krauser 2024-12-16 17:41:26 +01:00
parent ac5a7e7427
commit 52a1f34162
2 changed files with 7 additions and 3 deletions

View file

@ -41,14 +41,16 @@ export async function executeQuery(req: Request, res: Response): Promise<any> {
let [rows, total] = await DynamicQueryBuilder.buildQuery(query, offset, count).getManyAndCount();
res.json({
stats: "success",
rows: rows,
total: total,
offset: offset,
count: count,
});
} catch (error) {
res.status(500).send({
json: error.sql,
res.json({
stats: "error",
sql: error.sql,
code: error.code,
msg: error.sqlMessage,
});

View file

@ -43,7 +43,9 @@ export type WhereOperation =
| "notNull" // Is not null
| "between" // Is between
| "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 = {
column: string;