Skip to content

Schema Search

You inherited a Trino cluster with dozens of catalogs, hundreds of schemas, and thousands of tables. Someone asks “where’s the customer data?” and you have no idea which catalog it lives in. trinops ships an offline schema cache so you can search table and column names without hitting Trino every time.

The schema workflow has two phases: refresh (fetch metadata from Trino and cache it locally) and search (query the local cache).

Fetch metadata for a single catalog:

Terminal window
trinops schema refresh --catalog hive

Or discover and fetch all catalogs at once:

Terminal window
trinops schema refresh --all

The cache is stored per-profile, so different Trino clusters keep their metadata separate. The schema list command shows what you have cached.

Use glob patterns to find tables:

Terminal window
trinops schema search "customer*"
trinops schema search "*order*"
trinops schema search "analytics.page_*"

The pattern matches against table names by default. Results are displayed as a Rich table with catalog, schema, table name, and table type.

Add --columns to search column names instead:

Terminal window
trinops schema search --columns "email"
trinops schema search --columns "*_id"

Column search results include the catalog, schema, table, column name, and data type.

Terminal window
trinops schema search "*event*" --catalog iceberg

schema show doubles as a hierarchy browser. The argument determines the level of detail:

Terminal window
# List all cached catalogs
trinops schema show
# List schemas in a catalog
trinops schema show hive
# List tables in a schema
trinops schema show hive.analytics
# Show columns for a table
trinops schema show hive.analytics.page_views

An unqualified name like users is matched as a table name across all catalogs. If it matches a catalog name instead, the catalog’s schemas are shown.

Add --recursive (or -r) to expand everything below the current level into a tree:

Terminal window
# Full tree: all catalogs → schemas → tables → columns
trinops schema show --recursive
# Everything in one catalog
trinops schema show hive --recursive
# All tables with columns in a schema
trinops schema show hive.analytics --recursive
Terminal window
trinops schema list

This prints a table of cached catalogs with the profile name, catalog name, table count, column count, and when the data was fetched.

Every search and show command supports --json for machine-readable output:

Terminal window
trinops schema search "*order*" --json
trinops schema show orders --json

Combine --json with --recursive to get the full nested structure:

Terminal window
# Dump the entire cache as JSON
trinops schema show --json
# All tables and columns in a catalog
trinops schema show hive --json --recursive
# All tables with columns in a schema
trinops schema show hive.analytics --json --recursive

Combine --json with jq for pipeline-friendly queries:

Terminal window
# Find all tables containing "event" and extract just the fully qualified names
trinops schema search "*event*" --json | \
jq -r '.[] | "\(.catalog).\(.schema).\(.table)"'
# List column names and types for a specific table
trinops schema show page_views --json | \
jq -r '.[].columns[] | "\(.name)\t\(.type)"'
CommandDescription
schema refreshFetch metadata from Trino and cache locally
schema search <pattern>Search cached table or column names using glob patterns
schema show [name]Browse hierarchy or show table columns; --recursive to expand
schema listList all cached catalogs

See the CLI Reference for the full set of flags on each command.