Skip to main content

mr mrql

For the complete DSL syntax reference (operators, fields, GROUP BY, SCOPE, traversal), see the MRQL Reference docs-site page.

MRQL (Mahresources Query Language) is a small DSL for querying the mahresources data model across Resources, Notes, and Groups. A single expression selects an entity type and applies filters, scope, ordering, limit, and optional GROUP BY aggregations — for example type = resource AND tags = "photo" or type = resource GROUP BY contentType COUNT().

The top-level mrql command executes a one-off query supplied as a positional argument, via -f <file>, or on stdin with -. Use the subcommands to manage saved queries: save to register a named query, list to discover them, run to execute a saved query by name or ID, and delete to remove one. Saved MRQL queries differ from SQL-based query records (see query run): MRQL is the high-level DSL, whereas query executes raw read-only SQL.

Usage

mr mrql [query]

Positional arguments:

  • <query> (optional)

Flags

FlagTypeDefaultDescription
--filestring``Read query from file
--limitint0Items per bucket for GROUP BY, or total items for regular queries
--bucketsint0Groups per page for bucketed GROUP BY queries
--offsetint0Bucket offset for cursor-based GROUP BY pagination
--renderboolfalseRequest server-side template rendering via CustomMRQLResult

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)

Exit Codes

0 on success; 1 on any error

See Also