Kater CLI Build an analysis workspace source
kater workspace source use
Sets the shared model that a workspace reads, or changes it to another one.
Only the model that the workspace’s SQL reads from changes, and the rest of the SQL stays. Run it with --dry-run first to see the new workspace.sql.
Examples
# Go to the snowflake_prod_connection connection in your local copy of Kater contentcd connections/snowflake_prod_connection# Make the ad_reporting workspace read the shared ad_reporting modelkater workspace source use semantic.ad_reporting --scope workspaces/ad_reporting# See what changes when it reads the campaign report model, and save nothingkater workspace source use semantic.ad_reporting__campaign_report --scope workspaces/ad_reporting --dry-run# See the workspace's SQL as a query of every field of the model, and save nothingkater workspace source use semantic.ad_reporting --scope workspaces/ad_reporting --reset --dry-run# Check which queries and filters a change of model touches, with the request in check.jsonkater workspace source use --request-file check.jsonArguments
Options
It also takes the global options --json, --kater-root, --scope and --help.
Which workspace changes
Name the workspace with --scope, by its folder. Without --scope, Kater uses the scope that kater scope use saved, or else the folder you are in.
What changes
The workspace’s SQL keeps its filters and the fields it adds. Only the model it reads from changes. A filter or an added field can read a field that the new model does not have. The new workspace.sql then leaves that filter or field out.
Check a change before you make it
A request with "action": "check" says what changes when the workspace reads another model, and writes nothing. It names each query that compiles against the workspace, each filter, and each field the workspace adds. Without from_model, it checks the model that the workspace reads now. It names the queries that read a field the model does not have.
{"action": "check", "namespace": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting"}, "from_model": "semantic.ad_reporting__campaign_report"}The request takes other actions too. options lists the models the workspace can read. prepare proposes the new workspace.sql, and apply writes it with the revision that prepare gave.