Skip to main content
Version: Next

DatasourceQuerySchema

cache_timeoutintegernullable

Seconds to cache for; -1 disables caching.

Possible values: >= -1

Default value: null
dimensions[]

Dimension/column names to group by.

filters object[]

Filters to apply, AND-ed together.

  • Array [
  • colrequired

    The column to filter by. Can be either a string (physical or saved expression) or an object (adhoc column)

    Example: country
    grainstring

    Optional time grain for temporal filters

    Example: PT1M
    isExtraboolean

    Indicates if the filter has been added by a filter component as opposed to being a part of the original query.

    opstringrequired

    The comparison operator.

    Possible values: [==, !=, >, <, >=, <=, LIKE, NOT LIKE, ILIKE, NOT ILIKE, IS NULL, IS NOT NULL, IN, NOT IN, IS TRUE, IS FALSE, TEMPORAL_RANGE, CONTAINS_ANY, CONTAINS_ALL, IS_EMPTY, IS_NOT_EMPTY, LENGTH_EQUALS, LENGTH_GREATER_THAN, LENGTH_LESS_THAN, LENGTH_GREATER_THAN_OR_EQUALS, LENGTH_LESS_THAN_OR_EQUALS]

    Example: IN
    valnullable

    The value or values to compare against. Can be a string, integer, decimal, None or list, depending on the operator.

    Example: ["China","France","Japan"]
  • ]
  • forceboolean
    Default value: false
    limitintegernullable

    Rows to return. Also clamped server-side by ROW_LIMIT.

    Possible values: >= 1 and <= 50000

    Default value: null
    metrics[]

    Saved metric names, or ad-hoc metric objects (datasets only). See ChartDataAdhocMetricSchema.

    offsetinteger

    Rows to skip, for pagination.

    Possible values: >= 0

    Default value: 0
    order object[]

    Ordering terms, applied in sequence. Each carries its own direction.

  • Array [
  • columnstringrequired

    Metric or dimension name to sort by.

    descendingboolean

    Sort this column descending.

    Default value: true
  • ]
  • result_formatstring

    'json' (default) or 'arrow' for an Arrow IPC stream.

    Possible values: [csv, json, xlsx, arrow]

    Default value: json
    time_columnstringnullable

    Temporal column the time range applies to. Inferred from the datasource when omitted.

    Default value: null
    time_grainstringnullable

    ISO 8601 duration, e.g. 'P1D' or 'PT1H'.

    Default value: null
    time_rangestringnullable

    e.g. 'Last 30 days' or '2024-01-01 : 2024-12-31'.

    Default value: null
    use_cacheboolean
    Default value: true
    DatasourceQuerySchema
    {
    "cache_timeout": null,
    "dimensions": [
    null
    ],
    "filters": [
    {
    "col": "country",
    "grain": "PT1M",
    "isExtra": true,
    "op": "IN",
    "val": [
    "China",
    "France",
    "Japan"
    ]
    }
    ],
    "force": false,
    "limit": null,
    "metrics": [
    null
    ],
    "offset": 0,
    "order": [
    {
    "column": "string",
    "descending": true
    }
    ],
    "time_column": null,
    "time_grain": null,
    "time_range": null,
    "use_cache": true
    }