Preprocessor that does simple transformations to all incoming queries, simplifing the driver-specific implementations.
Preprocessor that does simple transformations to all incoming queries, simplifing the driver-specific implementations.
Bind this to true
to print debugging messages when processing the query.
Bind this to `true` to print debugging messages when processing the query.
(process-query query)
Inputs: [query] Returns: QueryResponse
Process an MBQL query. This is the main entrypoint to the magical realm of the Query Processor. Returns a
core.async channel if option :async?
is true; otherwise returns results in the usual format. For async queries, if
the core.async channel is closed, the query will be canceled.
Inputs: [query] Returns: QueryResponse Process an MBQL query. This is the main entrypoint to the magical realm of the Query Processor. Returns a core.async channel if option `:async?` is true; otherwise returns results in the usual format. For async queries, if the core.async channel is closed, the query will be canceled.
(process-query-and-save-execution! query options)
Inputs: [query options :- mbql.s/Info]
Process and run a 'userland' MBQL query (e.g. one ran as the result of an API call, scheduled Pulse, MetaBot query, etc.). Returns results in a format appropriate for consumption by FE client. Saves QueryExecution row in application DB.
Inputs: [query options :- mbql.s/Info] Process and run a 'userland' MBQL query (e.g. one ran as the result of an API call, scheduled Pulse, MetaBot query, etc.). Returns results in a format appropriate for consumption by FE client. Saves QueryExecution row in application DB.
(process-query-and-save-with-max-results-constraints! query options)
Inputs: [query options :- mbql.s/Info]
Same as process-query-and-save-execution!
but will include the default max rows returned as a constraint. (This
function is ulitmately what powers most API endpoints that run queries, including POST /api/dataset
.)
Inputs: [query options :- mbql.s/Info] Same as `process-query-and-save-execution!` but will include the default max rows returned as a constraint. (This function is ulitmately what powers most API endpoints that run queries, including `POST /api/dataset`.)
(query->native query)
Return the native form for query
(e.g. for a MBQL query on Postgres this would return a map containing the compiled
SQL form). (Like preprocess
, this function will throw an Exception if preprocessing was not successful.)
(Currently, this function is mostly used by tests and in the REPL; mbql-to-native/mbql->native
middleware handles
simliar functionality for queries that are actually executed.)
Return the native form for `query` (e.g. for a MBQL query on Postgres this would return a map containing the compiled SQL form). (Like `preprocess`, this function will throw an Exception if preprocessing was not successful.) (Currently, this function is mostly used by tests and in the REPL; `mbql-to-native/mbql->native` middleware handles simliar functionality for queries that are actually executed.)
(query->native-with-spliced-params query)
Return the native form for a query
, with any prepared statement (or equivalent) parameters spliced into the query
itself as literals. This is used to power features such as 'Convert this Question to SQL'.
(Currently, this function is mostly used by tests and in the REPL; splice-params-in-response
middleware handles
simliar functionality for queries that are actually executed.)
Return the native form for a `query`, with any prepared statement (or equivalent) parameters spliced into the query itself as literals. This is used to power features such as 'Convert this Question to SQL'. (Currently, this function is mostly used by tests and in the REPL; `splice-params-in-response` middleware handles simliar functionality for queries that are actually executed.)
(query->preprocessed query)
Return the fully preprocessed form for query
, the way it would look immediately before mbql->native
is called.
Especially helpful for debugging or testing driver QP implementations.
Return the fully preprocessed form for `query`, the way it would look immediately before `mbql->native` is called. Especially helpful for debugging or testing driver QP implementations.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close