From c4e65a34dbd15277d3d67a2c043e38618041ec2b Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Sat, 28 Dec 2024 13:20:14 +0100 Subject: [PATCH] Updates --- package-shared/functions/dsql/sql/sql-generator.js | 2 ++ package-shared/types/index.d.ts | 1 + package-shared/types/index.ts | 1 + package.json | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package-shared/functions/dsql/sql/sql-generator.js b/package-shared/functions/dsql/sql/sql-generator.js index 5701364..811925d 100644 --- a/package-shared/functions/dsql/sql/sql-generator.js +++ b/package-shared/functions/dsql/sql/sql-generator.js @@ -200,7 +200,9 @@ function sqlGenerator({ tableName, genObject }) { ? `${tableName}.${genObject.order.field}` : genObject.order.field } ${genObject.order.strategy}`; + if (genObject.limit) queryString += ` LIMIT ${genObject.limit}`; + if (genObject.offset) queryString += ` OFFSET ${genObject.offset}`; return { string: queryString, diff --git a/package-shared/types/index.d.ts b/package-shared/types/index.d.ts index f52138c..cbfaae8 100644 --- a/package-shared/types/index.d.ts +++ b/package-shared/types/index.d.ts @@ -912,6 +912,7 @@ export type ServerQueryParam = { selectFields?: string[]; query?: ServerQueryQueryObject; limit?: number; + offset?: number; order?: { field: string; strategy: "ASC" | "DESC"; diff --git a/package-shared/types/index.ts b/package-shared/types/index.ts index 61b1231..76f121a 100644 --- a/package-shared/types/index.ts +++ b/package-shared/types/index.ts @@ -1090,6 +1090,7 @@ export type ServerQueryParam = { selectFields?: string[]; query?: ServerQueryQueryObject; limit?: number; + offset?: number; order?: { field: string; strategy: "ASC" | "DESC"; diff --git a/package.json b/package.json index 8be49d1..e26c54e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/datasquirel", - "version": "3.2.3", + "version": "3.2.4", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {