Skip to main content
On this page

Kater CLI Build an analysis query

kater query list

Lists the queries in a workspace in the order of its tabs, with each query's revision.

Use it to get the revisions that kater query reorder needs. It changes nothing.

Examples

Terminal window
# List the ad_reporting workspace's queries, with the request in list.json
kater query list --request-file list.json
# Send the same request on standard input
echo '{"namespace": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting"}}' | kater query list --request-file -

Arguments

ArgumentDescription
<path>Optional. In place of --request-file: the workspace, the query file or the chart file the request names.

Options

OptionDescription
--request-file <file>The JSON request, which names the workspace. - reads it from standard input. See The request.

It also takes the global options --json, --kater-root, --scope and --help.

The request

The request names the workspace by its path from the content root:

list.json
{"namespace": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting"}}

What it answers

queries lists the workspace’s queries in its own order, which query_order in workspace.sql holds. Each query has these keys:

  • name, path and label.
  • ordinal, its place in the order, from 0.
  • revision, the SHA-256 of its file.
  • charts, the number of charts that read it.
  • empty, when it has no SQL yet.
  • id, which kater run --select and a run’s inputs file take.

workspace_revision is the revision of workspace.sql, which kater query reorder sends back. The answer also gives the workspace’s label and the optional filters that its dashboard opens with (filters). tiles counts the dashboard’s tiles that show a chart, and reads_model says whether the workspace reads a model yet.

See also