Skip to content

refactor: replace user-facing "connection" with "catalog" (keep wire contract) - #245

Merged
eddietejeda merged 1 commit into
mainfrom
refactor/remove-connections-concept
Aug 3, 2026
Merged

refactor: replace user-facing "connection" with "catalog" (keep wire contract)#245
eddietejeda merged 1 commit into
mainfrom
refactor/remove-connections-concept

Conversation

@eddietejeda

Copy link
Copy Markdown
Contributor

What

Remove the user-facing concept of a "connection" from the CLI and skills, renaming it to "catalog". Scope is user-facing only — the wire contract is untouched.

Stacked on #244 (this PR's base is refactor/skills-nested-subskills); GitHub will retarget it to main once #244 merges.

Why

"Connection" was overloaded in what users see:

  • It named the attachable/queryable thing (databases attach, cross-source joins).
  • Stale ingest-client comments called a datasource a "connection" (a different server concept — /ingest/sources vs /connections, different id-spaces).
  • A query hint even pointed at hotdata connections list, a command that does not exist.

Since a connection is distinct from a datasource, the right user-facing term is catalog — it's already how the thing is addressed in SQL (<catalog>.schema.table) and via --catalog/--alias, and the resolver error already said "no catalog with id".

Wire contract — deliberately unchanged

  • /connections/... endpoint paths, and the connection_id / default_connection_id JSON keys (still emitted by -o json).
  • The data_refresh_connection job-type value — still shown in the jobs TYPE column and typed via --job-type, because the server defines that enum string. This is the one place the word remains user-visible; removing it needs a backend change.
  • connection_string credential keys (Postgres DSNs).
  • Internal Rust identifiers and private-fn rustdoc that track the wire concept.

Changes

CLI (user-facing)

  • databases attach/detach: help, printed success/failure, and the positional arg (<CONNECTION><CATALOG>); create --attach help; fork help.
  • databases delete arg help; databases show human label default_connection_id:catalog id: (the -o json key is unchanged).
  • indexes delete --catalog help note; the two query cross-catalog hints (one had referenced the non-existent hotdata connections list).
  • Removed the deprecated hidden ingest *-connection aliases; fixed the ingest-client comments that called a datasource a "connection".

Skills

  • connectioncatalog throughout (attach, cross-catalog joins, data-model template); renamed the "Querying across connections" heading/anchor to -catalogs- and updated every link.
  • Corrected the earlier connectionsdatasources mis-mapping from refactor(skills): bundle search/analytics/geospatial under hotdata + fix CLI drift #244: onboarding / model-building now discover queryable catalogs + tables (databases list, tables list), with ingest datasources as a separate optional step.

Verification

  • cargo build + cargo test pass (updated the two databases_cli.rs help assertions); cargo fmt --check clean.
  • Grepped every relevant --help output: the only remaining user-facing "connection" is the wire-locked data_refresh_connection job value.
  • All skills relative links + the renamed anchor resolve; the only "connection" left in skills is data_refresh_connection and connection_string (both wire).

Note (not addressed here)

tests/connections_read.rs and tests/auth_unknown_workspace.rs invoke hotdata connections list — a command that doesn't exist in the CLI. These are production scenario tests mirroring a server-side test-scenarios.yaml. They're pre-existing and out of scope for this PR, but worth a look: either the scenario contract expects a connections command the CLI never implemented, or the tests are stale.

@eddietejeda
eddietejeda requested a review from a team as a code owner August 2, 2026 18:25
@eddietejeda
eddietejeda requested review from zfarrell and removed request for a team August 2, 2026 18:25
Base automatically changed from refactor/skills-nested-subskills to main August 3, 2026 03:39
…contract)

"Connection" was overloaded in the user-facing surface: it named the
attachable/queryable thing (`databases attach`, cross-source joins), duplicated
the ingest "datasource" concept in stale comments, and even appeared as a
`hotdata connections list` command that does not exist. A connection is a
distinct server concept from a datasource, so the fix is to rename what users
see to "catalog" (how it's already addressed in SQL: `<catalog>.schema.table`,
and via `--catalog`/`--alias`) — not to "datasource".

Scope is user-facing only. The wire contract is untouched: `/connections/...`
endpoints, the `connection_id`/`default_connection_id` JSON keys, the
`data_refresh_connection` job-type value (still shown/typed in `jobs --job-type`
because the server defines it), and `connection_string` credential keys all stay.
Internal identifiers and private-fn rustdoc that say "connection" are left as-is
(they track the wire concept).

CLI (user-facing):
- `databases attach`/`detach`: help, printed output, and the positional arg
  (`<CONNECTION>` -> `<CATALOG>`); `create --attach` help; `fork` help.
- `databases delete` arg help; `databases show` label `default_connection_id:`
  -> `catalog id:` (the `-o json` key is unchanged).
- `indexes delete --catalog` help note; two `query` cross-catalog hints (one had
  pointed at the non-existent `hotdata connections list`).
- Removed the deprecated hidden `ingest *-connection` aliases; corrected the
  ingest-client comments that called a datasource a "connection".

Skills:
- Renamed "connection" -> "catalog" throughout (attach, cross-catalog joins,
  data-model template); renamed the "Querying across connections" anchor to
  "-catalogs-" and updated all links.
- Corrected the earlier connections->datasources mis-mapping: onboarding /
  model-building now discover queryable catalogs+tables (`databases list`,
  `tables list`), with ingest datasources as a separate optional step.
@eddietejeda
eddietejeda force-pushed the refactor/remove-connections-concept branch from 88d3ffa to a70f17d Compare August 3, 2026 03:49
**Skill:** **`hotdata`**

A `hotdata query` runs inside **one** managed database; its scope sees that database's own catalog plus **attached** connection catalogs only. To query a connection's tables — or join a managed table against a live connection table in one query — attach the connection. (No managed database set → *"a database is required."*; an unattached catalog → *"table not found."*)
A `hotdata query` runs inside **one** managed database; its scope sees that database's own catalog plus **attached** catalog catalogs only. To query a catalog's tables — or join a managed table against a live catalog table in one query — attach the catalog. (No managed database set → *"a database is required."*; an unattached catalog → *"table not found."*)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: (not blocking) The mechanical rename garbled this sentence — "attached catalog catalogs", and "join a managed table against a live catalog table" now reads as a tautology (the managed database is itself a catalog). Since skills are agent-facing instructions, ambiguity here has a real cost.

Suggested change
A `hotdata query` runs inside **one** managed database; its scope sees that database's own catalog plus **attached** catalog catalogs only. To query a catalog's tables — or join a managed table against a live catalog table in one query — attach the catalog. (No managed database set → *"a database is required."*; an unattached catalog → *"table not found."*)
A `hotdata query` runs inside **one** managed database; its scope sees that database's own catalog plus any **attached** catalogs only. To query another catalog's tables — or join a managed table against a live attached table in one query — attach that catalog. (No managed database set → *"a database is required."*; an unattached catalog → *"table not found."*)

```

- **Fully qualify tables** as `<connection>.<schema>.<table>` (or `<catalog>.<schema>.<table>` for a managed database) — every `<table>` placeholder below means a qualified name.
- **Fully qualify tables** as `<catalog>.<schema>.<table>` (or `<catalog>.<schema>.<table>` for a managed database) — every `<table>` placeholder below means a qualified name.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: (not blocking) After the rename both halves of this sentence are identical, so the parenthetical says nothing: "as <catalog>.<schema>.<table> (or <catalog>.<schema>.<table> for a managed database)".

Suggested change
- **Fully qualify tables** as `<catalog>.<schema>.<table>` (or `<catalog>.<schema>.<table>` for a managed database) — every `<table>` placeholder below means a qualified name.
- **Fully qualify tables** as `<catalog>.<schema>.<table>` (for a managed database, `<catalog>` is its SQL alias) — every `<table>` placeholder below means a qualified name.

```

For each datasource, record `id`, `name`, and `source_type`.
For each catalog, record its name and the tables it exposes. (Pulling *new* external data into a managed database is a separate step — see the `ingest` datasource commands in the core skill.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: (not blocking) The old step 1 was the only place that told the agent to record source_type, but section 3 still keys off it ("Use connector and tooling docs when source_type (or table shapes) match", line 53). Now nothing in the walkthrough produces it. Worth adding a clause here — e.g. "for ingest-backed catalogs, also record source_type from hotdata ingest list-datasources (used in step 3)".

Comment thread skills/hotdata/SKILL.md
hotdata databases attach <connection_id|name> [--database <id>] [--alias <alias>]
hotdata databases detach <connection_id|name|alias> [--database <id>]
# Attach a catalog so its tables are queryable (enables cross-catalog queries — see below)
hotdata databases attach <catalog|name> [--database <id>] [--alias <alias>]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: (not blocking) <connection_id|name><catalog|name> loses the id/name distinction the old form carried — as written, name looks like an alternative to a catalog rather than one way to name one. <catalog_id|name> would keep the parallel (same for detach on the next line: <catalog_id|name|alias>).

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 26.66667% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/commands/databases.rs 0.00% 7 Missing ⚠️
src/main.rs 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename is consistent; wire contract (connection_id, /connections/*, data_refresh_connection, connection_string) is correctly left alone, main.rs destructuring matches the renamed clap fields, and no stale #querying-across-connections-attach anchors or references to the removed ingest *-connection aliases remain outside historical CHANGELOG entries. Four non-blocking doc nits inline.

@eddietejeda
eddietejeda merged commit 977aec2 into main Aug 3, 2026
14 checks passed
@eddietejeda
eddietejeda deleted the refactor/remove-connections-concept branch August 3, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant