Skip to content

Commit 0392d57

Browse files
committed
docs(skills): reference source database by id in fork workflow; document set as id-only
1 parent 5f78374 commit 0392d57

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

skills/hotdata/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ Returns workspaces with `public_id`, `name`, `active`, `favorite`, `provision_st
8888

8989
**Parquet only:** `databases tables load` accepts **parquet** files (local `--file`, remote `--url`, or a pre-staged `--upload-id`).
9090

91-
**Active database:** `hotdata databases set <id_or_description>` saves the active database to config. All `databases tables` subcommands and all `context` commands default to the active database; pass **`--database <id>`** to override per-command.
91+
**Active database:** `hotdata databases set <id>` saves the active database to config. All `databases tables` subcommands and all `context` commands default to the active database; pass **`--database <id>`** to override per-command.
9292

9393
```
9494
hotdata databases list [--workspace-id <workspace_id>] [--output table|json|yaml]
9595
hotdata databases create [--name <display_name>] [--catalog <alias>] [--table <table> ...] [--schema public] [--expires-at <duration|timestamp>] [--workspace-id <workspace_id>] [--output table|json|yaml]
9696
hotdata databases fork [<id_or_name>] [--name <display_name>] [--expires-at <duration|timestamp>] [--workspace-id <workspace_id>] [--output table|json|yaml]
97-
hotdata databases set <id_or_name>
97+
hotdata databases set <id>
9898
hotdata databases unset
9999
hotdata databases <id_or_name> [--workspace-id <workspace_id>] [--output table|json|yaml]
100100
hotdata databases delete <id_or_name> [--workspace-id <workspace_id>]
@@ -117,7 +117,7 @@ hotdata databases tables delete <table> [--database <id_or_name>] [--schema publ
117117
- `list` — all managed databases in the workspace. Active database is marked with `*` under the DEFAULT column; CREATED shows when each database was made.
118118
- `create` — creates a new managed database. `--name` is an optional human-readable display name. `--catalog` sets the SQL alias used in queries (`SELECT … FROM <catalog>.schema.table`); must be `[a-z_][a-z0-9_]*`. `--expires-at` accepts relative durations (`24h`, `7d`, `90m`) or an RFC 3339 timestamp; omitting means no expiry. Repeat `--table` to declare tables up front.
119119
- `fork` — creates a new managed database that is an independent deep copy of an existing one (same schemas, tables, and data); the source is left unchanged and the two diverge freely afterwards. The source defaults to the active database; pass `<id_or_name>` (id, catalog, or name) to fork another. `--name` defaults to `<source>-fork` (so the two stay distinguishable in `list`); `--expires-at` accepts a relative duration or RFC 3339 timestamp, and when omitted a still-future source expiry is carried over. The fork becomes the active database on success. The fork answers to the **same catalog alias** as its source inside its own scope; connection catalogs attached to the source are **re-attached** to the fork, but indexes are **not** carried over. Only databases created with the current (DuckLake) storage engine can be forked — older parquet-backed databases return an error.
120-
- `set` — saves `<id_or_name>` as the active database. Subsequent `databases tables` and `context` commands use it automatically. Note that a successful `fork` also updates this: the fork becomes the active database.
120+
- `set` — saves the database **id** as the active database (unlike `fork`, `delete`, and inspect, `set` does not resolve catalog aliases or names — pass the `dbid...` id). Subsequent `databases tables` and `context` commands use it automatically. Note that a successful `fork` also updates this: the fork becomes the active database.
121121
- `unset` — clears the active database from config.
122122
- `<id_or_name>` — inspect one database (id, catalog, name, expires_at).
123123
- `delete` — removes the managed database; clears the active-database config if it matched.

skills/hotdata/references/WORKFLOWS.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,13 @@ For **Chain** materializations into managed databases, see **`hotdata-analytics`
137137
Before destructive experimentation (bulk replaces, schema rework, testing a load pipeline), fork the database and experiment on the copy — the source stays untouched and the two diverge freely:
138138

139139
```bash
140-
hotdata databases set sales # source to protect
141-
hotdata databases fork --expires-at 24h # deep copy; becomes the active database
140+
hotdata databases list # note the source database id (dbid...)
141+
hotdata databases set <source_id> # source to protect (`set` takes an id)
142+
hotdata databases fork --expires-at 24h # deep copy; becomes the active database
142143
hotdata databases load --catalog sales --table orders --file ./risky.parquet # hits the fork
143144
```
144145

145-
The fork answers to the same catalog alias as its source, so experimental SQL runs unchanged. Attached connections are re-attached to the fork; indexes are not carried over. When done, keep the fork (`databases set` back to the source) or `databases delete` it. Only DuckLake-backed databases can be forked — see `fork` in the main skill for details.
146+
**Capture the source database id up front.** After the fork, both databases answer to the same catalog alias (here `sales`), so the id is the only unambiguous way to refer back to the source. The shared alias means experimental SQL runs unchanged against the fork. Attached connections are re-attached to the fork; indexes are not carried over. When done, keep the fork (`databases set <source_id>` to switch back to the source) or `databases delete` it. Only DuckLake-backed databases can be forked — see `fork` in the main skill for details.
146147

147148
---
148149

0 commit comments

Comments
 (0)