Mprove
.mdx

get-query-info

Usage

➜  ~ mprove get-query-info -h
Get query info

━━━ Usage ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

$ mprove get-query-info

━━━ Options ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  --project-id #0       (required) Project Id
  --repo-type #0        (required, "dev", "production" or "session")
  --branch #0           (required) Git Branch
  --env #0              (required) Environment
  --dashboard-id #0     (dashboard-id, chart-id or report-id required) Dashboard Id (name)
  --tile-index #0       (optional) Dashboard Tile Index starting with 0
  --chart-id #0         (dashboard-id, chart-id or report-id required) Chart Id (name)
  --report-id #0        (dashboard-id, chart-id or report-id required) Report Id (name)
  --row-id #0           (optional) Report Row Id
  --timezone #0         (default "UTC") Timezone
  --detail #0           (default "days") for Report -  "timestamps" | "seconds" | "minutes" | "hours" | "days" | "weeks" | "months" | "quarters" | "years"
  --range #0            (default "f`last 5 days`") for Report - Ts Filter Expression
  --get-malloy          (default false), show malloy query in output
  --get-sql             (default false), show query sql in output
  --get-data            (default false), show query data in output
  --json                (default false)
  --env-file-path #0    (optional) Path to ".env" file

━━━ Examples ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Get Query Info for Chart
  $ mprove get-query-info --project-id DXYE72ODCP5LWPWH2EXQ --repo-type dev --branch main --env prod --chart-id v1 --get-malloy --get-sql --get-data

Get Query Info for Dashboard
  $ mprove get-query-info --project-id DXYE72ODCP5LWPWH2EXQ --repo-type dev --branch main --env prod --dashboard-id d1 --get-malloy --get-sql --get-data

Get Query Info for Report
  $ mprove get-query-info --project-id DXYE72ODCP5LWPWH2EXQ --repo-type dev --branch main --env prod --report-id r1 --get-malloy --get-sql --get-data

Example Output

➜  ~ mprove get-query-info \
--env-file-path /mprove/.env \
--project-id DXYE72ODCP5LWPWH2EXQ \
--repo-type dev \
--branch main \
--env prod \
--dashboard-id TDEXWBE5PI2X17CJCFKC \
--tile-index 0 \
--get-sql \
--get-malloy

dashboard: 
  title:       Ecom
  dashboardId: TDEXWBE5PI2X17CJCFKC
  url:         https://app.mprove.io/org/AWNCAHWLFQTQJYCH3ZSE/project/DXYE72ODCP5LWPWH2EXQ/repo/UPXRRK83O347QLFNDX4H/branch/main/env/prod/dashboards/dashboard/TDEXWBE5PI2X17CJCFKC?timezone=UTC
  tiles: 
    - 
      title: Average Sale Price by Category
      query: 
        connectionId:         c1_postgres
        connectionType:       PostgreSQL
        queryId:              c5ad3abf96a15da1d7f7bae0ca9f7ca92388265fa9d56388f3fbbc890c7aaabf
        status:               Completed
        lastRunBy:            UPXRRK83O347QLFNDX4H
        lastRunTs:            1765907902094
        lastCancelTs:         null
        lastCompleteTs:       1765907902712
        lastCompleteDuration: 0
        lastErrorTs:          null
        malloy:
          """
            <malloy query>
          """
        sql:
          """
            <sql query>
          """

On this page