Add more features to the query generator

This commit is contained in:
2026-04-18 14:59:23 +01:00
parent f3f1c42699
commit 9c5d39edfb
19 changed files with 375 additions and 83 deletions
+8 -2
View File
@@ -1,4 +1,10 @@
export default function sqlGenGrabConcatStr({ alias, field, separator = ",", }) {
let gc = `GROUP_CONCAT(${field}, '${separator}') AS ${alias}`;
export default function sqlGenGrabConcatStr({ alias, field, separator = ",", distinct, }) {
let gc = `GROUP_CONCAT(`;
if (distinct) {
gc += `DISTINCT `;
}
gc += `${field}, '${separator}'`;
gc += `)`;
gc += ` AS ${alias}`;
return gc;
}