In Oracle and some other databases, empty strings are considered to be Drivers can derive from this abstract driver to use an alternate implementation(s) of SQL QP method(s) that treat
empty strings as | (ns metabase.driver.sql.query-processor.empty-string-is-null (:require [metabase.driver :as driver] [metabase.driver.sql.query-processor :as sql.qp])) |
(driver/register! ::empty-string-is-null, :abstract? true) | |
(defmethod sql.qp/->honeysql [::empty-string-is-null :value] [driver [_ value info]] (let [value (when-not (= value "") value)] ((get-method sql.qp/->honeysql [:sql :value]) driver [:value value info]))) | |
(prefer-method sql.qp/->honeysql [::empty-string-is-null :value] [:sql :value]) | |