diff options
author | Vitor Mattos <vitor@php.rio> | 2021-12-21 12:18:15 -0300 |
---|---|---|
committer | Vitor Mattos <vitor@php.rio> | 2022-01-03 07:48:11 -0300 |
commit | 79b3df00f82f3d0eee397f5389d23c8af1727afd (patch) | |
tree | 69bd942fd443b7f560ae6d0dbd72f2b1be873e00 /lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php | |
parent | 29dffd7e7fc84faa6a4317c691c6cac9eaf42f42 (diff) | |
download | nextcloud-server-79b3df00f82f3d0eee397f5389d23c8af1727afd.tar.gz nextcloud-server-79b3df00f82f3d0eee397f5389d23c8af1727afd.zip |
Add group_concat aggregator function
Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php')
-rw-r--r-- | lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php index 5581207a166..af72d85d511 100644 --- a/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php +++ b/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php @@ -72,4 +72,11 @@ class OCIFunctionBuilder extends FunctionBuilder { return parent::least($x, $y); } + + public function groupConcat($expr, ?string $separator = ','): IQueryFunction { + if (is_null($separator)) { + return new QueryFunction('LISTAGG(' . $this->helper->quoteColumnName($expr)); + } + return new QueryFunction('LISTAGG(' . $this->helper->quoteColumnName($expr) . ", '$separator')"); + } } |