queryBuilder->expr()->castColumn($item, IQueryBuilder::PARAM_STR); } return new QueryFunction(sprintf('(%s)', implode(' || ', $list))); } public function groupConcat($expr, ?string $separator = ','): IQueryFunction { $castedExpression = $this->queryBuilder->expr()->castColumn($expr, IQueryBuilder::PARAM_STR); if (is_null($separator)) { return new QueryFunction('string_agg(' . $castedExpression . ')'); } $separator = $this->connection->quote($separator); return new QueryFunction('string_agg(' . $castedExpression . ', ' . $separator . ')'); } }