From 517e75215bef0851dbf43681fa2c4e064aa39b17 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 23 Nov 2019 18:17:20 +0100 Subject: [PATCH] Add ORDER support --- src/helpers/DatabaseHelper.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/helpers/DatabaseHelper.ts b/src/helpers/DatabaseHelper.ts index 2610d10..299d0ca 100644 --- a/src/helpers/DatabaseHelper.ts +++ b/src/helpers/DatabaseHelper.ts @@ -11,6 +11,7 @@ export interface QueryInformation { table: string, fields ?: Array, where ?: Object, + order ?: string, limit ?: number, } @@ -87,6 +88,10 @@ export class DatabaseHelper { request = request.substr(0, request.length - 4) } + // Order (if any) + if(info.order) + request += " ORDER BY " + info.order + " "; + // Limit (if any) if(info.limit) request += " LIMIT " + info.limit;