ReferenceSources & data
data query
Query row data from a resource with filtering, sorting, and pagination.
Reads the actual rows of a resource — a source's table, a reconciliation output, and so on — with
filtering, sorting, and pagination. This is the data-browsing command; describe and source describe show metadata, data query shows the data itself.
Filter with --filter (a SQL-like expression) or --filter-json (structured). Sort with --sort
(col ascending, -col descending), pick columns with --fields, and page with --page /
--page-size (max 200 rows). --count adds the total row count but is slower. For large pulls,
--csv streams CSV to stdout; --timeout caps how long the query may run.
Requires CLI access to the workspace. See permissions.
Arguments
resource_id— Resource ID to query
Flags
-f, --filter <expr>— SQL-like filter expression--filter-json <json>— Structured JSON filters-s, --sort <ordering>— Ordering: col (ASC), -col (DESC)--fields <cols>— Comma-separated column names--segment <id>— Segment ID-p, --page <n>— Page number--page-size <n>— Rows per page (max 200)--count— Include total row count (slower)--timeout <seconds>— Max wait in seconds--format <fmt>— Output: table|json|csv--csv— Output as CSV (shorthand for --format csv)
Examples
simetrik data query res_abc123 --filter "amount > 1000" --sort -amount
simetrik data query res_abc123 --fields id,amount,status --page-size 100 --count
simetrik data query res_abc123 --csv > rows.csvExit codes
| Code | Meaning |
|---|---|
0 | Rows returned |
2 | Invalid input — bad filter expression or unknown resource_id |
3 | Query timed out — raise --timeout or narrow the filter |
4 | Authentication required — run simetrik login |