This commit is contained in:
2025-11-17 11:12:19 +01:00
parent 5fcfc4dc2c
commit 8eebe3215a
8 changed files with 31 additions and 19 deletions
@@ -44,7 +44,7 @@ export default async function <
})
: undefined;
if (count && countQueryObject) {
if ((count || countOnly) && countQueryObject) {
connQueries.push({
query: countQueryObject.string,
values: countQueryObject.values,
@@ -88,12 +88,16 @@ export default async function <
sql: queryObject?.string,
params: queryObject?.values,
},
countQueryObject: {
sql: countQueryObject?.string,
params: countQueryObject?.values,
},
count: isSuccess
? res[1]?.[0]?.["COUNT(*)"]
? res[1][0]["COUNT(*)"]
: res[0]?.[0]?.["COUNT(*)"]
? res[0][0]["COUNT(*)"]
: undefined
: 0
: undefined,
};
}