statswales_get_query: Inspect a stored query configuration

View source: R/statswales_get_query.R

statswales_get_queryR Documentation

Inspect a stored query configuration

Description

Returns the full configuration of a stored query, including the applied filters, total row count, column mappings, and the underlying SQL. The filter_id is returned by any call to statswales_get_dataset() (via the POST /data step) or statswales_get_pivot().

Usage

statswales_get_query(dataset_id, filter_id)

Arguments

dataset_id

A dataset UUID string.

filter_id

A 12-character query identifier returned by the API.

Details

To retrieve the filter_id directly, call statswales_create_query().

Value

A list containing the stored query details:

id

The filter ID.

totalLines

Total number of rows matching the query.

requestObject

The filter and options that were submitted.

columnMapping

Mapping between internal column names and display names, per language.

query

A named list of SQL strings keyed by language code.

Returns NULL if the request fails.

Examples

## Not run: 
datasets <- statswales_list_datasets()
id <- datasets$id[1]

fid <- statswales_create_query(id)
query_info <- statswales_get_query(id, fid)
query_info$totalLines

## End(Not run)


statswalesr documentation built on July 12, 2026, 5:06 p.m.