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.
Workflow
Section titled “Workflow”The schema workflow has two phases: refresh (fetch metadata from Trino and cache it locally) and search (query the local cache).
Refresh the cache
Section titled “Refresh the cache”Fetch metadata for a single catalog:
trinops schema refresh --catalog hiveOr discover and fetch all catalogs at once:
trinops schema refresh --allThe cache is stored per-profile, so different Trino clusters keep their metadata separate. The schema list command shows what you have cached.
Search for tables
Section titled “Search for tables”Use glob patterns to find tables:
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.
Search for columns
Section titled “Search for columns”Add --columns to search column names instead:
trinops schema search --columns "email"trinops schema search --columns "*_id"Column search results include the catalog, schema, table, column name, and data type.
Limit to a specific catalog
Section titled “Limit to a specific catalog”trinops schema search "*event*" --catalog icebergBrowse the schema hierarchy
Section titled “Browse the schema hierarchy”schema show doubles as a hierarchy browser. The argument determines the level of detail:
# List all cached catalogstrinops schema show
# List schemas in a catalogtrinops schema show hive
# List tables in a schematrinops schema show hive.analytics
# Show columns for a tabletrinops schema show hive.analytics.page_viewsAn 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.
Recursive expansion
Section titled “Recursive expansion”Add --recursive (or -r) to expand everything below the current level into a tree:
# Full tree: all catalogs → schemas → tables → columnstrinops schema show --recursive
# Everything in one catalogtrinops schema show hive --recursive
# All tables with columns in a schematrinops schema show hive.analytics --recursiveList cached catalogs
Section titled “List cached catalogs”trinops schema listThis prints a table of cached catalogs with the profile name, catalog name, table count, column count, and when the data was fetched.
JSON output
Section titled “JSON output”Every search and show command supports --json for machine-readable output:
trinops schema search "*order*" --jsontrinops schema show orders --jsonCombine --json with --recursive to get the full nested structure:
# Dump the entire cache as JSONtrinops schema show --json
# All tables and columns in a catalogtrinops schema show hive --json --recursive
# All tables with columns in a schematrinops schema show hive.analytics --json --recursiveScripting with jq
Section titled “Scripting with jq”Combine --json with jq for pipeline-friendly queries:
# Find all tables containing "event" and extract just the fully qualified namestrinops schema search "*event*" --json | \ jq -r '.[] | "\(.catalog).\(.schema).\(.table)"'
# List column names and types for a specific tabletrinops schema show page_views --json | \ jq -r '.[].columns[] | "\(.name)\t\(.type)"'Commands reference
Section titled “Commands reference”| Command | Description |
|---|---|
schema refresh | Fetch 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 list | List all cached catalogs |
See the CLI Reference for the full set of flags on each command.