(ns metabase-enterprise.audit-app.interface (:require [metabase.plugins.classloader :as classloader] [metabase.util.i18n :refer [tru]] [metabase.util.malli.schema :as ms])) | |
Schema for the expected format for | (def ResultsMetadata [:sequential {:min 1} [:tuple ms/KeywordOrString [:map [:base_type ms/FieldType] [:display_name ms/NonBlankString]]]]) |
Define a new internal query type. Conventionally | (defmulti internal-query {:arglists '([query-type & args])} (fn [query-type & _] (keyword query-type))) |
(defmethod internal-query :default [query-type & _] (throw (ex-info (str (tru "Unable to run internal query function: cannot resolve {0}" query-type)) {:status-code 400}))) | |
Invoke the internal query with | (defn resolve-internal-query [query-type & args] (let [query-type (keyword query-type) ns-str (namespace query-type)] (when ns-str (classloader/require (symbol ns-str))) (apply internal-query query-type args))) |