Skip to content

docs: describe attach as joining across instant databases - #309

Merged
eddietejeda merged 3 commits into
mainfrom
docs/attach-instant-databases
Sep 19, 2026
Merged

eddietejeda merged 3 commits into
mainfrom
docs/attach-instant-databases

Conversation

@eddietejeda

Copy link
Copy Markdown
Contributor

Summary

Docs half of runtimedb#1382 / runtimedb#1412, which makes attach take an instant database's catalog — the only kind of catalog the product still creates. The CLI needs no code change for that (its resolver already turns a database name into default_connection_id), but the docs still describe attach as a workspace-catalog operation, and one of them documents a command that could never have worked.

The README's "Join across sources" example attaches prod-replica — a thing a reader would reasonably hold as an instant database, and which 409'd until now. It now reads as what it always looked like.

Changes throughout: "attach a catalog" → "attach another instant database"; "cross-catalog join" → "cross-database join"; the stale phrases "workspace catalog" and "external catalog" are gone, along with the anchors that pointed at the old section name.

Three facts that were not documented anywhere and are worth an agent knowing:

  • Read-only — loads always target your own database's catalog, never an attached one. skills/hotdata/subskills/search/** claimed you could index a table by attaching its catalog first; you cannot, and it now says to index it in its own database instead.
  • Not transitive — you see the database you attached, not the ones it attached.
  • Lifecycle — the source cannot be deleted while you hold it (that delete is now refused), but an expiring source still goes on its expires_at. That asymmetry is the one thing likely to surprise someone, so it is called out where attach is documented.

Files: README.md, skills/hotdata/SKILL.md, references/WORKFLOWS.md, references/DATA_MODEL.template.md, references/MODEL_BUILD.md, subskills/analytics/SKILL.md, subskills/search/SKILL.md, subskills/search/references/INDEXES.md.

Test plan

  • cargo test — all targets pass (docs-only change; the clap help assertions in tests/databases_cli.rs still hold).
  • Cross-references checked: no remaining link to the old #querying-across-catalogs-attach anchor, and rg -i "cross-catalog|workspace catalog|external catalog" over skills/ and README.md is empty.

Merge after runtimedb#1412 deploys — until then the README example still 409s.

@eddietejeda
eddietejeda requested a review from a team as a code owner September 18, 2026 22:21
@eddietejeda
eddietejeda requested review from rohan-hotdata and removed request for a team September 18, 2026 22:21
Comment thread skills/hotdata/references/WORKFLOWS.md Outdated
2. [ ] `hotdata search list` — avoid duplicate text/vector indexes on the same column
3. [ ] Create index (address by name):
- [ ] **Instant DB only:** `hotdata search create <tbl>_<col> --type text --from <alias>.public.<tbl> --column <text_col>` (vector: `--type vector [--provider <p>]`). An external catalog must be attached to an instant database first (`hotdata databases attach`).
- [ ] **Instant DB only:** `hotdata search create <tbl>_<col> --type text --from <alias>.public.<tbl> --column <text_col>` (vector: `--type vector [--provider <p>]`). A table in another database must be attached first (`hotdata databases attach <database>`).

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.

This line keeps the claim the PR removes elsewhere. Replace it with the INDEXES.md rule: build the index in the database that owns the table, or load a copy into this one.

skills/hotdata/subskills/search/references/INDEXES.md:42 now states that attaching does not make a table indexable. This checklist step still tells the agent to attach first, and it links to INDEXES.md as its detail page.

Failure scenario: an agent follows the Retrieval checklist, runs hotdata databases attach other-db --alias o, then hotdata search create t_body --type text --from o.public.t --column body. The server rejects the create, because the target table belongs to a read-only attached database. The agent has no next step, because the checklist named attach as the fix.

Comment thread README.md
JOIN prod.public.orders o ON o.ticket_id = t.id"
```

The attached database is read-only here: loads still go to your own database,

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: the command table at README.md:168 still reads "Attach a catalog so its tables are queryable", and line 169 still reads "Detach a previously attached catalog" (not blocking). A reader who scans the table sees the old model, two sections below the new one. Reword both rows to match this section.

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

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: hotdata databases attach --help still describes the old model (not blocking). src/commands/databases.rs:128 reads "Attach a catalog to an instant database", and the --attach help at src/commands/databases.rs:69 uses --attach github as its example. The skill docs and the CLI help now disagree. Updating those doc comments needs the matching assertions in tests/databases_cli.rs checked.

@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.

Review

Blocking Issues

  • skills/hotdata/references/WORKFLOWS.md:66 — the Retrieval checklist still says a table in another database must be attached before indexing. skills/hotdata/subskills/search/references/INDEXES.md:42 in this same PR says attaching does not make a table indexable. The two documents contradict each other, and WORKFLOWS.md links to INDEXES.md as its detail page.

Action Required

  • Rewrite WORKFLOWS.md:66 to match the INDEXES.md rule: build the index in the database that owns the table, or load a copy into the current database.

Two non-blocking comments are inline: the README command table and the clap help strings still use the old catalog wording.

@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

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

📢 Thoughts on this report? Let us know!

WORKFLOWS.md told an agent to attach another database before indexing
its table, which INDEXES.md in the same change says does not work — an
attached database is read-only, so the index create is rejected and the
checklist offers no next step. Both now say to build the index in the
database that owns the table.

Also brings the README command table and the clap help for attach and
create --attach onto the new wording, with the assertion that pins the
documented alias form.
Comment thread src/commands/databases.rs Outdated
/// Read-only: loads still target this database's own catalog. Not
/// transitive: you see what you attached, not what it attached.
Attach {
/// Catalog name or id to attach (e.g. `github`)

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: this argument help keeps the catalog model that the long help above now replaces (not blocking).

A reader of hotdata databases attach --help sees both models on one screen. The github example is the workspace-catalog case this PR removes from README.md and skills/hotdata/SKILL.md.

src/commands/databases.rs:147 and src/commands/databases.rs:152 carry the same old wording. Reword all three. No test asserts on them — tests/databases_cli.rs:54 checks only --alias and --database.

claude[bot]
claude Bot previously approved these changes Sep 18, 2026
…atalog

The positional arg, --alias, Detach, the show label, the attach success
message and one line of SKILL.md still described attach as taking a
catalog while everything around them had moved to 'another instant
database'. The positional now renders as <DATABASE>, matching the
documented synopsis, and --alias says when it is required: the attached
database's own catalog alias is the default, and 'default' cannot be
attached under its own name, so a database created without --catalog
needs one.
@eddietejeda

Copy link
Copy Markdown
Contributor Author

Second pass from the full review: the remaining old-vocabulary strings are gone — positional arg (now renders <DATABASE>), --alias, Detach, the attached databases: show label, the attach success message, and SKILL.md:226's 'attached source'. Test names updated to match.

Also documented, because runtimedb#1412's review surfaced it: --alias is required when the attached database kept the stock default catalog name, since default cannot be attached under its own name. That was true all along and undocumented.

Two review candidates I did not act on, deliberately:

  • The claim that --alias defaults to the literal string typed. It doesn't — the server derives the default from the source's default_catalog_alias (that is the whole point of #1412), regardless of what the CLI sent. The doc is correct.
  • try_resolve_connection_id checking workspace connections before instant databases. Real, pre-existing precedence behaviour, and changing resolution order is a behaviour change that belongs in its own PR — noted for follow-up.

@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.

All four prior threads are resolved: the WORKFLOWS.md retrieval step now states the ownership rule, the README command table rows match the new section, and the clap doc comments plus positional value names no longer describe the catalog model. Docs and --help agree. No remaining findings.

Note: the CI / test check was still queued when this review ran, so the updated assertions in tests/databases_cli.rs are not confirmed passing here.

@eddietejeda
eddietejeda merged commit c28cad5 into main Sep 19, 2026
14 checks passed
@eddietejeda
eddietejeda deleted the docs/attach-instant-databases branch September 19, 2026 16:12
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