From 57f06a631f336840fd10cccc27717153155fda5f Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Wed, 3 Dec 2025 21:31:18 +0100 Subject: [PATCH] Updates --- .../functions/dsql/sql/sql-generator.js | 5 +++-- dist/package-shared/types/index.d.ts | 2 ++ package-shared/functions/dsql/sql/sql-generator.ts | 12 ++++++++++-- package-shared/types/index.ts | 2 ++ package.json | 2 +- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/dist/package-shared/functions/dsql/sql/sql-generator.js b/dist/package-shared/functions/dsql/sql/sql-generator.js index 465f913..74615e7 100644 --- a/dist/package-shared/functions/dsql/sql/sql-generator.js +++ b/dist/package-shared/functions/dsql/sql/sql-generator.js @@ -142,12 +142,13 @@ function sqlGenerator({ tableName, genObject, dbFullName, count }) { let countSqls = []; for (let i = 0; i < genObject.countSubQueries.length; i++) { const countSubQuery = genObject.countSubQueries[i]; + const tableAlias = countSubQuery.table_alias; let subQStr = `(SELECT COUNT(*)`; - subQStr += ` FROM ${countSubQuery.table}`; + subQStr += ` FROM ${countSubQuery.table}${tableAlias ? ` ${tableAlias}` : ""}`; subQStr += ` WHERE (`; for (let j = 0; j < countSubQuery.srcTrgMap.length; j++) { const csqSrc = countSubQuery.srcTrgMap[j]; - subQStr += ` ${countSubQuery.table}.${csqSrc.src}`; + subQStr += ` ${tableAlias || countSubQuery.table}.${csqSrc.src}`; if (typeof csqSrc.trg == "string") { subQStr += ` = ?`; sqlSearhValues.push(csqSrc.trg); diff --git a/dist/package-shared/types/index.d.ts b/dist/package-shared/types/index.d.ts index 2cb34a7..17a749b 100644 --- a/dist/package-shared/types/index.d.ts +++ b/dist/package-shared/types/index.d.ts @@ -846,6 +846,8 @@ export type ServerQueryParamFullTextSearch