On this page
Kater CLI Build an analysis query
kater query reorder
Changes the order of the queries in a workspace, which is the order of its tabs.
Kater writes the new order into workspace.sql, and no query file changes.
Examples
# Get the revision of the ad_reporting workspace's query orderrevision=$(echo '{"namespace": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting"}}' | kater query list --request-file - | jq -r .workspace_revision)# Put spend_by_platform and paid_media_spend_trend firstjq -n --arg revision "$revision" '{namespace: {path: "connections/snowflake_prod_connection/workspaces/ad_reporting"}, names: ["spend_by_platform", "paid_media_spend_trend"], expected_revision: $revision}' | kater query reorder --request-file -# Send a request that you keep in reorder.jsonkater query reorder --request-file reorder.jsonArguments
Options
It also takes the global options --json, --kater-root, --scope and --help.
The request
| Key | What it holds |
|---|---|
namespace | The workspace, by its path from the content root, such as {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting"}. |
names | The workspace’s queries in their new order, by name. A query that the list leaves out keeps its place, after these. |
expected_revision | The workspace_revision that kater query list gives. Kater refuses the change when workspace.sql changed since. |