Expand description
User-visible catalog of data tables in the workspace.
Tracks, for every user-facing table:
| Field | Who populates |
|---|---|
table_name | MCP (stub) |
load_tool | MCP (stub) |
load_params | MCP (stub) |
loaded_at | MCP (stub) |
last_refreshed_at | MCP (stub, bumped on every explicit load) |
row_count | MCP (stub, refreshed opportunistically) |
source_url | User / LLM via set_table_metadata |
source_description | User / LLM |
purpose | User / LLM |
license | User / LLM |
notes | User / LLM |
The backing table is _table_catalog (single underscore, not
_hyperdb_) so it shows up in describe and the resource catalog — the
catalog is meant to be read by humans and LLMs, it isn’t internal
bookkeeping. The _ prefix signals “workspace meta” without triggering
crate::engine::is_internal_table’s hidden-table filter.
All operations no-op quietly when HyperMcpServer was constructed with
--bare: the module never gets called in that mode, so the table is
never created and the workspace file stays pristine.
Structs§
- Catalog
Entry - One row in
TABLE_CATALOG_TABLE. - Metadata
Fields - Partial update payload for
set_metadata.Nonemeans “leave the existing value alone”;Some(String::new())clears the field.
Constants§
- TABLE_
CATALOG_ TABLE - Backing table name. Visible in
describe; users canSELECT * FROM _table_catalogdirectly.
Functions§
- delete_
for - Delete the catalog row (if any) for
table_name. Called when a table is dropped. Idempotent — no error if the row doesn’t exist. - ensure_
exists - Idempotently create the backing table in the primary workspace. Safe
to call on every engine init — if the table already exists this is
a no-op. The schema here is the only one the code targets; all
prose columns are nullable, so a plain
NULLinsert is always well-formed. - ensure_
exists_ in_ database - Idempotently create
_table_cataloginside an attached database (fully qualified as"{db_alias}"."public"."_table_catalog"), with the same schema as the primary’s catalog. - get
- Fetch a single row by
table_name, orOk(None)if absent. - list
- Fetch every catalog row in name-sorted order. Returns an empty
Vecif the catalog table doesn’t exist (callers shouldn’t need to pre-check). - reconcile
- Synchronize the catalog against the current set of user tables.
- set_
metadata - Partial UPDATE of prose fields for one table. Errors with
ErrorCode::TableNotFoundif there is no catalog row fortable_name(callers can decide whether to first stub viaupsert_stubor surface the error). - upsert_
stub - Upsert a catalog row for
table_name, carrying forward prose fields from any existing row and refreshing mechanical fields.