# The Query object

## Attributes

- `id` (string)
  UUID identifying the query.
  Example: `fe25e731-92f2-4838-9fb2-1ca364320a3d`
- `display_name` (string)
  Display name of the query that appears in list views, widget headings, and on the query page.
  Example: `Example query`
- `description` (string)
  General description that conveys additional information about this query such as usage notes.
  Example: `Example description`
- `owner_user_name` (string)
  Username of the user that owns the query.
  Example: `user@acme.com`
- `warehouse_id` (string)
  ID of the SQL warehouse attached to the query.
  Example: `a7066a8ef796be84`
- `query_text` (string)
  Text of the query to be run.
  Example: `SELECT 1`
- `run_as_mode` (string)
  Sets the "Run as" role for the object.
  Possible values: `OWNER`, `VIEWER`
- `lifecycle_state` (string)
  Indicates whether the query is trashed.
  Possible values: `ACTIVE`, `TRASHED`
- `last_modifier_user_name` (string)
  Username of the user who last saved changes to this query.
  Example: `user@acme.com`
- `parent_path` (string)
  Workspace path of the workspace folder containing the object.
  Example: `/Users/user@acme.com`
- `tags` (array of string)
- `create_time` (string)
  Timestamp when this query was created.
- `update_time` (string)
  Timestamp when this query was last updated.
- `parameters` (array of object)
  List of query parameter definitions.
  - `title` (string)
    Text displayed in the user-facing parameter widget in the UI.
  - `name` (string)
    Literal parameter marker that appears between double curly braces in the query text.
  - `text_value` (object)
    Text query parameter value.
    - `value` (string)
  - `numeric_value` (object)
    Numeric query parameter value.
    - `value` (double)
  - `enum_value` (object)
    Dropdown query parameter value.
    - `values` (array of string)
      List of selected query parameter values.
    - `enum_options` (string)
      List of valid query parameter values, newline delimited.
    - `multi_values_options` (object)
      If specified, allows multiple values to be selected for this parameter.
      - `prefix` (string)
        Character that prefixes each selected parameter value.
      - `separator` (string)
        Character that separates each selected parameter value. Defaults to a comma.
      - `suffix` (string)
        Character that suffixes each selected parameter value.
  - `date_value` (object)
    Date query parameter value. Can only specify one of `dynamic_date_value` or `date_value`.
    - `dynamic_date_value` (string)
      Dynamic date-time value based on current date-time.
      Possible values: `NOW`, `YESTERDAY`
    - `date_value` (string)
      Manually specified date-time value.
    - `precision` (string)
      Date-time precision to format the value into when the query is run. Defaults to DAY_PRECISION (YYYY-MM-DD).
      Possible values: `DAY_PRECISION`, `MINUTE_PRECISION`, `SECOND_PRECISION`
  - `date_range_value` (object)
    Date-range query parameter value. Can only specify one of `dynamic_date_range_value` or `date_range_value`.
    - `dynamic_date_range_value` (string)
      Dynamic date-time range value based on current date-time.
      Possible values: `TODAY`, `YESTERDAY`, `THIS_WEEK`, `THIS_MONTH`, `THIS_YEAR`, `LAST_WEEK`, `LAST_MONTH`, `LAST_YEAR`, `LAST_HOUR`, `LAST_8_HOURS`, `LAST_24_HOURS`, `LAST_7_DAYS`, `LAST_14_DAYS`, `LAST_30_DAYS`, `LAST_60_DAYS`, `LAST_90_DAYS`, `LAST_12_MONTHS`
    - `date_range_value` (object)
      Manually specified date-time range value.
      - `start` (string)
      - `end` (string)
    - `precision` (string)
      Date-time precision to format the value into when the query is run. Defaults to DAY_PRECISION (YYYY-MM-DD).
      Possible values: `DAY_PRECISION`, `MINUTE_PRECISION`, `SECOND_PRECISION`
    - `start_day_of_week` (int32)
  - `query_backed_value` (object)
    Query-based dropdown query parameter value.
    - `values` (array of string)
      List of selected query parameter values.
    - `query_id` (string)
      UUID of the query that provides the parameter values.
    - `multi_values_options` (object)
      If specified, allows multiple values to be selected for this parameter.
      - `prefix` (string)
        Character that prefixes each selected parameter value.
      - `separator` (string)
        Character that separates each selected parameter value. Defaults to a comma.
      - `suffix` (string)
        Character that suffixes each selected parameter value.
- `apply_auto_limit` (boolean)
  Whether to apply a 1000 row limit to the query result.
- `catalog` (string)
  Name of the catalog where this query will be executed.
- `schema` (string)
  Name of the schema where this query will be executed.

## Example

```json
{
  "id": "fe25e731-92f2-4838-9fb2-1ca364320a3d",
  "display_name": "Example query",
  "description": "Example description",
  "owner_user_name": "user@acme.com",
  "warehouse_id": "a7066a8ef796be84",
  "query_text": "SELECT 1",
  "run_as_mode": "string",
  "lifecycle_state": "string",
  "last_modifier_user_name": "user@acme.com",
  "parent_path": "/Users/user@acme.com",
  "tags": [
    "string"
  ],
  "create_time": "string",
  "update_time": "string",
  "parameters": [
    {
      "title": "string",
      "name": "string",
      "text_value": {},
      "numeric_value": {},
      "enum_value": {},
      "date_value": {},
      "date_range_value": {},
      "query_backed_value": {}
    }
  ],
  "apply_auto_limit": true,
  "catalog": "string",
  "schema": "string"
}
```


