import { escapeStringLiteral, quoteIdentifier } from "./sql-identifier"; export default function sqlGenGrabConcatStr({ alias, field, separator = ",", distinct, }) { let gc = `GROUP_CONCAT(`; if (distinct) { gc += `DISTINCT `; } gc += `${field}`; if (!distinct) { gc += `, '${escapeStringLiteral(separator)}'`; } gc += `)`; gc += ` AS ${quoteIdentifier(alias)}`; return gc; }