These are declarations — placeholders the SQL author defines. Schema lives in metabase.lib.schema.template-tag. Each tag has a :type:
:type |
Purpose |
|---|---|
:text, :number, :date, :boolean |
Scalar variable substitution: WHERE x = {{var}} |
| How Models Work in Metabase: QP & Lib | |
| What is a Model? | |
| A Model is a Card with :type :model (legacy: dataset = true), stored in the report_card table. The key distinguishing fields beyond :dataset-query are: | |
| - :result_metadata — an array of column metadata maps (user-editable: display names, semantic types, FK targets, visibility, etc.) | |
| - :type :model — distinguishes from :question and :metric | |
| --- |
These are declarations — placeholders the SQL author defines. Schema lives in metabase.lib.schema.template-tag. Each tag has a :type:
:type |
Purpose |
|---|---|
:text, :number, :date, :boolean |
Scalar variable substitution: WHERE x = {{var}} |
| { | |
| "$ref" : "#/components/schemas/metabase.lib.schema.query", | |
| "definitions" : { | |
| "metabase.lib.schema.metadata.stage" : { | |
| "description" : "Metadata about the columns returned by a particular stage of a pMBQL query. For example a single-stage native query\n like\n\n {:database 1\n :lib/type :mbql/query\n :stages [{:lib/type :mbql.stage/mbql\n :native \"SELECT id, name FROM VENUES;\"}]}\n\n might have stage metadata like\n\n {:columns [{:name \"id\", :base-type :type/Integer}\n {:name \"name\", :base-type :type/Text}]}\n\n associated with the query's lone stage.\n\n At some point in the near future we will hopefully attach this metadata directly to each stage in a query, so a\n multi-stage query will have `:lib/stage-metadata` for each stage. The main goal is to facilitate things like\n returning lists of visible or filterable columns for a given stage of a query. This is TBD, see #28717 for a WIP\n implementation of this idea.\n\n This is the |
| {actions [analytics session request embedding public-sharing], | |
| analytics [], | |
| analyze [analytics session request embedding public-sharing actions warehouses sync], | |
| api [], | |
| api-keys [analytics session request embedding server], | |
| app-db [], | |
| appearance [], | |
| audit-app [analytics session request embedding public-sharing actions search], | |
| auth-provider [app-db], | |
| batch-processing [analytics session request embedding queries view-log], |
| {actions [channel collections queries public-sharing], | |
| analytics [channel], | |
| analyze [channel collections api-keys users enterprise/advanced-permissions warehouses sync], | |
| api [], | |
| api-keys [channel collections], | |
| app-db [], | |
| appearance [], | |
| audit-app [channel collections], | |
| auth-provider [app-db], | |
| batch-processing [channel collections api-keys users], |
| (ns parse-test-output | |
| (:require | |
| [clojure.string])) | |
| (defn x [] | |
| (let [files ["https://productionresultssa12.blob.core.windows.net/actions-results/ff158da9-6207-4ca8-b2ac-bdc5aa49f855/workflow-job-run-991d6487-d703-5cca-92c6-1c67eaf3db9d/logs/job/job-logs.txt?rsct=text%2Fplain&se=2025-10-03T18%3A47%3A21Z&sig=e6iMXbt%2FecC1uhMsSbwk%2BLZO2TpzizqvVxM3fKEfOus%3D&ske=2025-10-04T02%3A42%3A25Z&skoid=ca7593d4-ee42-46cd-af88-8b886a2f84eb&sks=b&skt=2025-10-03T14%3A42%3A25Z&sktid=398a6654-997b-47e9-b12b-9515b896b4de&skv=2025-11-05&sp=r&spr=https&sr=b&st=2025-10-03T18%3A37%3A16Z&sv=2025-11-05" | |
| "/home/cam/x.txt"]] | |
| (into (sorted-set) | |
| (comp (map slurp) | |
| (mapcat clojure.string/split-lines) |
| (defn split-tests [[_deftest test-name & args]] | |
| (into [] | |
| (comp (mapcat (fn split* [expr] | |
| (case (first expr) | |
| is (let [[_is assert-expr message] expr] | |
| [(if message | |
| (list 'testing message | |
| (list 'is assert-expr)) | |
| (list 'is assert-expr))]) |
| (def ^:dynamic *depth* -1) | |
| (defn- middleware-fn-name [middleware-fn] | |
| (if-let [fn-name (:name (meta middleware-fn))] | |
| (if-let [fn-ns (:ns (meta middleware-fn))] | |
| (symbol (format "%s/%s [%d]" (ns-name fn-ns) fn-name *depth*)) | |
| fn-name) | |
| middleware-fn)) | |
| (defn- print-query-diff [middleware-fn before after] |
| (ns metabase.lib.schema.profile | |
| (:require | |
| [clojure.pprint] | |
| [clojure.set] | |
| [criterium.core] | |
| [metabase.util :as u] | |
| [metabase.util.malli.registry :as mr] | |
| [metabase.util.memoize :as u.memo])) | |
| (defn normalize-map-no-kebab-case |
| digraph { | |
| "actions" -> "analytics" | |
| "actions" -> "api" | |
| "actions" -> "collections" | |
| "actions" -> "driver" | |
| "actions" -> "legacy-mbql" | |
| "actions" -> "lib" | |
| "actions" -> "model-persistence" | |
| "actions" -> "models" | |
| "actions" -> "queries" |