Various record types below are used as a convenience for differentiating the different param types. | (ns metabase.driver.common.parameters (:require [potemkin.types :as p.types] [pretty.core :as pretty])) |
"FieldFilter" is something that expands to a clause like "some_field BETWEEN 1 AND 10"
{:type :date/single :value #t "2019-09-20T19:52:00.000-07:00"}
| (p.types/defrecord+ FieldFilter [field value] pretty/PrettyPrintable (pretty [this] (list (pretty/qualify-symbol-for-*ns* `map->FieldFilter) (into {} this)))) |
Is | (defn FieldFilter? [x] (instance? FieldFilter x)) |
A "ReferencedCardQuery" parameter expands to the native query of the referenced card.
| (p.types/defrecord+ ReferencedCardQuery [card-id query params] pretty/PrettyPrintable (pretty [this] (list (pretty/qualify-symbol-for-*ns* `map->ReferencedCardQuery) (into {} this)))) |
Is | (defn ReferencedCardQuery? [x] (instance? ReferencedCardQuery x)) |
A
| (p.types/defrecord+ ReferencedQuerySnippet [snippet-id content] pretty/PrettyPrintable (pretty [this] (list (pretty/qualify-symbol-for-*ns* `map->ReferencedQuerySnippet) (into {} this)))) |
Is | (defn ReferencedQuerySnippet? [x] (instance? ReferencedQuerySnippet x)) |
as in a literal date, defined by date-string S TODO - why don't we just parse this into a Temporal type and let drivers handle it. | (p.types/defrecord+ Date [^String s] pretty/PrettyPrintable (pretty [_] (list (pretty/qualify-symbol-for-*ns* `->Date) s))) |
(p.types/defrecord+ DateRange [start end] pretty/PrettyPrintable (pretty [_] (list (pretty/qualify-symbol-for-*ns* `->DateRange) start end))) | |
(p.types/defrecord+ DateTimeRange [start end] pretty/PrettyPrintable (pretty [_] (list (pretty/qualify-symbol-for-*ns* `->DateRange) start end))) | |
Convenience for representing an optional parameter present in a query but whose value is unspecified in the param values. | (def no-value ::no-value) |
(p.types/defrecord+ Param [k] pretty/PrettyPrintable (pretty [_] (list (pretty/qualify-symbol-for-*ns* `->Param) k))) | |
(p.types/defrecord+ Optional [args] pretty/PrettyPrintable (pretty [_] (cons (pretty/qualify-symbol-for-*ns* `->Optional) args))) | |
Is
| (defn Param? [x] (instance? Param x)) |
Is | (defn Optional? [x] (instance? Optional x)) |