Skip to content
Snippets Groups Projects
Unverified Commit 2e3ef4fd authored by Ariya Hidayat's avatar Ariya Hidayat Committed by GitHub
Browse files

MBQL schema: allows :case for a string expression (#20913)

parent 702833f6
Branches jest-role-hidden
No related tags found
No related merge requests found
......@@ -421,7 +421,7 @@
(def string-expressions
"String functions"
#{:substring :trim :rtrim :ltrim :upper :lower :replace :concat :regex-match-first :coalesce})
#{:substring :trim :rtrim :ltrim :upper :lower :replace :concat :regex-match-first :coalesce :case})
(declare StringExpression)
......@@ -523,13 +523,6 @@
(defclause ^{:requires-features #{:expressions :regex}} regex-match-first
s StringExpressionArg, pattern s/Str)
(def ^:private StringExpression*
(one-of substring trim ltrim rtrim replace lower upper concat regex-match-first coalesce))
(def ^:private StringExpression
"Schema for the definition of an string expression."
(s/recursive #'StringExpression*))
(defclause ^{:requires-features #{:expressions}} +
x NumericExpressionArg, y NumericExpressionArgOrInterval, more (rest NumericExpressionArgOrInterval))
......@@ -570,6 +563,12 @@
"Schema for the definition of an arithmetic expression."
(s/recursive #'ArithmeticExpression*))
(declare StringExpression*)
(def ^:private StringExpression
"Schema for the definition of an string expression."
(s/recursive #'StringExpression*))
;;; ----------------------------------------------------- Filter -----------------------------------------------------
......@@ -728,6 +727,10 @@
(def ^:private ArithmeticExpression*
(one-of + - / * coalesce length floor ceil round abs power sqrt exp log case))
(def ^:private StringExpression*
(one-of substring trim ltrim rtrim replace lower upper concat regex-match-first coalesce case))
(def FieldOrExpressionDef
"Schema for anything that is accepted as a top-level expression definition, either an arithmetic expression such as a
`:+` clause or a `:field` clause."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment