aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php')
-rw-r--r--lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php
index 0b22775acc8..444f6aa83a4 100644
--- a/lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php
+++ b/lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php
@@ -28,8 +28,13 @@ use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\DB\QueryBuilder\IQueryFunction;
class PgSqlFunctionBuilder extends FunctionBuilder {
- public function concat($x, $y): IQueryFunction {
- return new QueryFunction('(' . $this->helper->quoteColumnName($x) . ' || ' . $this->helper->quoteColumnName($y) . ')');
+ public function concat($x, ...$expr): IQueryFunction {
+ $args = func_get_args();
+ $list = [];
+ foreach ($args as $item) {
+ $list[] = $this->queryBuilder->expr()->castColumn($item, IQueryBuilder::PARAM_STR);
+ }
+ return new QueryFunction(sprintf('(%s)', implode(' || ', $list)));
}
public function groupConcat($expr, ?string $separator = ','): IQueryFunction {