Updates
This commit is contained in:
@@ -205,13 +205,21 @@ export default function sqlGenerator<
|
||||
|
||||
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 += ` = ?`;
|
||||
|
||||
@@ -1035,6 +1035,8 @@ export type ServerQueryParamFullTextSearch<
|
||||
|
||||
export type ServerQueryParamsCount = {
|
||||
table: string;
|
||||
/** Alias for the Table From which the count is fetched */
|
||||
table_alias?: string;
|
||||
srcTrgMap: {
|
||||
src: string;
|
||||
trg: string | ServerQueryParamsCountSrcTrgMap;
|
||||
|
||||
Reference in New Issue
Block a user