Liking cljdoc? Tell your friends :D

metabase.query-processor.middleware.fetch-source-query

Middleware responsible for 'hydrating' the source query for queries that use another query as their source. This middleware looks for MBQL queries like

{:source-table "card__1" ; Shorthand for using Card 1 as source query ...}

and resolves the referenced source query, transforming the query to look like the following:

{:source-query {...} ; Query for Card 1 :source-metadata [...] ; metadata about columns in Card 1 ...}

This middleware resolves Card ID :source-tables at all levels of the query, but the top-level query often uses the so-called virtual-id, because the frontend client might not know the original Database; this middleware will replace that ID with the approiate ID, e.g.

{:database <virtual-id>, :type :query, :query {:source-table "card__1"}} -> {:database 1, :type :query, :query {:source-query {...}, :source-metadata {...}}}

TODO - consider renaming this namespace to metabase.query-processor.middleware.resolve-card-id-source-tables

Middleware responsible for 'hydrating' the source query for queries that use another query as their source. This
middleware looks for MBQL queries like

  {:source-table "card__1" ; Shorthand for using Card 1 as source query
   ...}

and resolves the referenced source query, transforming the query to look like the following:

  {:source-query    {...} ; Query for Card 1
   :source-metadata [...] ; metadata about columns in Card 1
   ...}

This middleware resolves Card ID `:source-table`s at all levels of the query, but the top-level query often uses the
so-called `virtual-id`, because the frontend client might not know the original Database; this middleware will
replace that ID with the approiate ID, e.g.

  {:database <virtual-id>, :type :query, :query {:source-table "card__1"}}
  ->
  {:database 1, :type :query, :query {:source-query {...}, :source-metadata {...}}}

TODO - consider renaming this namespace to `metabase.query-processor.middleware.resolve-card-id-source-tables`
raw docstring

resolve-card-id-source-tablesclj

(resolve-card-id-source-tables qp)

Middleware that assocs the :source-query for this query if it was specified using the shorthand :source-table card__n format.

Middleware that assocs the `:source-query` for this query if it was specified using the shorthand `:source-table`
`card__n` format.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close