From 4eabb7129e6b36c77c9567f3eceecc7b9015caa5 Mon Sep 17 00:00:00 2001 From: Aradhya-Tripathi Date: Mon, 8 Nov 2021 13:55:17 +0530 Subject: [PATCH] feat: Added concat_ws in frappe.qb --- frappe/query_builder/functions.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frappe/query_builder/functions.py b/frappe/query_builder/functions.py index 5ccb266945..39c67178c2 100644 --- a/frappe/query_builder/functions.py +++ b/frappe/query_builder/functions.py @@ -1,7 +1,14 @@ from pypika.functions import * +from pypika.terms import Function from frappe.query_builder.utils import ImportMapper, db_type_is from frappe.query_builder.custom import GROUP_CONCAT, STRING_AGG, MATCH, TO_TSVECTOR + +class Concat_ws(Function): + def __init__(self, *terms, **kwargs): + super(Concat_ws, self).__init__("CONCAT_WS", *terms, **kwargs) + + GroupConcat = ImportMapper( { db_type_is.MARIADB: GROUP_CONCAT,