Skip to main content

mr query get

Get a saved query by ID and print its metadata. Fetches the full record including Name, Text (the SQL), Template, Description, and created/updated timestamps. Output is a key/value table by default; pass the global --json flag to get the full record for scripting.

Usage

mr query get <id>

Positional arguments:

  • <id>

Examples

Get a query by ID (table output)

mr query get 42

Get as JSON and extract the SQL text

mr query get 42 --json | jq -r .Text

Flags

This command has no local flags.

Inherited global flags

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Output

Query object with ID (uint), Name (string), Text (string), Template (string), Description (string), CreatedAt, UpdatedAt

Exit Codes

0 on success; 1 on any error

See Also