Skip to main content
The query command group lets you execute SQL queries against a saved connection.

query sql

Executes a SQL query and returns results as JSON.
Options Examples Run a SELECT query:
Output (pretty-printed by default) By default, the output contains only the resultset array:
Use --compact for single-line output, suitable for piping to tools like jq:

Including column metadata

By default, the output omits the column metadata. Add --metadata to include a metadata array that describes each column returned:

Output format

Query results are returned as a JSON object. By default, it contains a single top-level key, resultset, an array of the rows returned by the driver. When you pass --metadata, the object also includes a metadata key that describes the columns returned. See Output format for more details on the JSON output structure.