dft query
Run a named query from a face and show columns + sample rows. The fastest way to verify that a query in your face actually returns what you expect.
Arguments
| Argument |
Description |
NAME |
Name of the query inside the face's queries: block. |
Options
| Flag |
Description |
--in PATH |
Path to the face YAML file. Required. |
--var KEY=VALUE |
Variable override (repeatable). |
--limit INT |
Max rows to return. Default 20, max 1000. |
--json |
Output JSON instead of a table. |
--project-dir PATH |
Project directory for resolving relative paths. |
Examples
# Run the `revenue` query from sales.yml, print first 20 rows
dft query revenue --in faces/sales.yml
# Limit output
dft query revenue --in faces/sales.yml --limit 5
# Pass variables
dft query revenue --in faces/sales.yml --var region=West
# Machine-readable output
dft query revenue --in faces/sales.yml --json
When to use what
| If you want to… |
Use |
| See what a single query returns |
dft query |
| Validate a SQL string for fanout / missing join predicates |
dft validate-query |
| Get the column schema for a SQL string without executing |
dft describe-query |
| Render the whole face |
dft render |