Skip to main content

mr query schema

List every database table and its columns, for use as a reference when authoring query Text. The response is a single JSON object whose keys are table names and whose values are arrays of column name strings. Both user-facing tables (e.g. resources, notes, groups) and internal FTS/virtual tables appear in the output.

Handy as a quick discovery tool before writing a new saved query or MRQL expression.

Usage

mr query schema

Examples

Dump the full schema as JSON

mr query schema

List only the column names of the resources table

mr query schema --json | jq -r '.resources[]'

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

Object mapping table name (string) to an array of column names (string[])

Exit Codes

0 on success; 1 on any error

See Also