Skip to main content
On this page

Kater CLI Find and understand model

kater model fields

Lists the fields of the model you are editing, and the fields of the models it can read.

It shows them as the field picker does. The model’s own fields come under ACTIVE, then each model it can read under SELECT FROM. Use it to find the field to add to a query or a model.

Examples

Terminal window
# Go to the snowflake_prod_connection connection
cd connections/snowflake_prod_connection
# List the fields of the spend_by_platform query, and the fields it can add
kater model fields --document workspaces/ad_reporting/query_contracts/spend_by_platform.sql
# List the fields that the ad_reporting workspace can read
kater model fields --scope workspaces/ad_reporting
# List the fields of the connection's shared models
kater model fields --scope modeling
# List the fields of the connection's database datasets
kater model fields --scope modeling/db_objects

Options

OptionDescription
--path <folder>A workspace or modeling folder whose fields to list, in place of your scope.
--files <file>Takes the workspace or modeling folder from this file. To list the fields of the file’s own model, use --document. You can give it more than one time.
--document <file>The file you are editing. Its model’s saved fields come first, and Kater leaves the file out of SELECT FROM.
--model <model>The model you are editing in --document, for a file that declares several, such as query.spend_by_platform. It needs --document.
--text-file <file>The text of --document in place of what is saved, such as an editor’s unsaved changes. - reads stdin. It needs --document.
--at <line>:<character>The cursor’s place in --document, counted from 0. Kater selects the model at that place. It needs --document.

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

What it lists

  • ACTIVE shows the model you are editing, with its own fields. It is empty when no model is selected.
  • SELECT FROM shows each model it can read, with its fields.
  • Each field of a model it can read has a mark. [ready] means that you can add it, and [present] means that the model has it already. [blocked] means that you cannot add it, and gives the reason.

With no option, it lists the fields for the model that kater scope use saved. With no saved scope, it uses the folder you are in.

What a model can read

What a model can read depends on its layer. See How modeling works.

  • A Kater dataset reads its database dataset.
  • A semantic model reads Kater datasets and other semantic models.
  • A workspace’s root reads its one shared model.
  • A query reads its workspace’s root, then the other queries in the same workspace.

A workspace is named by its full path. The path holds its connection and, for a personal workspace, its owner, such as connections/snowflake_prod_connection/users/you@example.com/workspaces/marketing_sessions.

See also