Skip to main content
On this page

Kater CLI Build an analysis parameter

kater parameter add

Add a parameter to a workspace, or to a query, such as a menu with a list of choices and a default.

A program gives the exact typed request with --request-file.

The request’s fields: label: The name people see on the input. Left out, it reads as the name in words. description: What the input is for, for the people who set it. ai_context: Guidance for an assistant that sets this input. kater_data_type: The value’s type: string, number, boolean, date, time or timestamp. parameter.add needs it. subtype: How many values it takes: single_value for one, range for two ordered endpoints, multiselect for several. parameter.add writes single_value when it is left out. default_value: The value used when none is given: one value, or a list for a range or a multiselect. It must be one of choices when the parameter has them. choices: The values a reader picks from, written as allowed_values.from_list, such as [“Spend”, “Clicks”, “Conversions”]. An empty list takes the choices out. min: The lowest value a number, date, time or timestamp parameter takes, written as min.from_value. Every default and every value a reader gives must meet it. Given as null, it takes the bound out. max: The highest value a number, date, time or timestamp parameter takes, written as max.from_value. Every default and every value a reader gives must meet it, and it must not be below min. Given as null, it takes the bound out. namespace (required): {kind?: “workspace”, scope: {kind?: “shared”, connection: text} or {kind?: “personal”, connection: text, user_id: text, topic?}, workspace: text}. The workspace the parameters are in. query: The query whose own parameters these are. Absent for the workspace root’s, which every query of the workspace shares. name (required): The parameter’s name in lower snake case, as the SQL reads it, such as trend_measure. expected_revision: The revision of the file as parameter.list gave it. A file that changed since is refused. Left out, the file as it is now. dry_run: Show the entry and the change to the file, and write nothing.

Examples

Terminal window
# Add a parameter to a workspace, or to a query, such as a menu with a list of choices and a default
kater parameter add

Arguments

ArgumentDescription
<object>Optional. The workspace, or one of its queries. A workspace: its key, such as duckdb_sample/shop, or in a person’s folder, duckdb_sample/users/<user id>/shop; its name, such as shop; its folder, such as connections/<connection>/workspaces/shop; or its id, rel1_…, also from before a rename. A query: its key, such as duckdb_sample/shop/top_regions, or in a person’s folder, duckdb_sample/users/<user id>/shop/top_regions; as <workspace>/<name>, such as shop/top_regions; its workspace’s folder and its name, such as connections/<connection>/workspaces/shop/top_regions; or its id, rel1_…, also from before a rename. By default the workspace you are in.

Options

OptionDescription
--request-file <file>Typed request JSON file; - reads stdin.
--name <name>The parameter’s name in lower snake case, such as trend_measure.
--label <text>The name people see on the input.
--description <text>What the input is for, for the people who set it.
--type <kater-data-type>The value’s type: string, number, boolean, date, time or timestamp.
--subtype <subtype>single_value for one value, range for a start and an end, multiselect for several values. Left out, a new parameter takes one value.
--default <default-value>The value used when none is given. Give it once for each value of a range or a multiselect. You can give it more than one time.
--choice <choice>A value a reader picks from. Give it once for each choice, such as --choice Spend --choice Clicks. You can give it more than one time.
--min <min>The lowest value a number, date, time or timestamp takes. Every default and every value a reader gives must meet it.
--max <max>The highest value a number, date, time or timestamp takes. Every default and every value a reader gives must meet it.
--revision <expected-revision>The file’s revision as kater parameter list gave it. A file that changed since is refused.
--dry-runShow the change to the file, and write nothing.

It also takes the global options anywhere on the line, and --help.

See also