Skip to content

Commit 447c349

Browse files
committed
docs: document 'databases run' in README and hotdata SKILL
1 parent 30bc4ef commit 447c349

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ hotdata databases list [-w <id>] [-o table|json|yaml]
137137
hotdata databases create --name <name> [--table <table> ...] [--schema public] [-o table|json|yaml]
138138
hotdata databases <name_or_id> [-o table|json|yaml]
139139
hotdata databases delete <name_or_id>
140+
hotdata databases run [--database <id>] [--description <label>] [--schema public] [--table <table> ...] [--expires-at <duration|timestamp>] <cmd> [args...]
141+
hotdata databases <id> run <cmd> [args...]
140142

141143
hotdata databases tables list <database> [--schema <name>] [-o table|json|yaml]
142144
hotdata databases tables load <database> <table> --file ./data.parquet [--schema public]
@@ -146,6 +148,7 @@ hotdata databases tables delete <database> <table> [--schema public]
146148

147149
- `create` registers a managed connection (`source_type: managed`) with no external credentials. Use `--table` to declare tables up front (required before `tables load` on the current API).
148150
- `tables load` uploads a **parquet** file (or uses a staged `upload_id` from `POST /v1/files`) and publishes it as the table generation (`replace` mode).
151+
- `run` mints a database-scoped JWT and execs `<cmd>` with `HOTDATA_DATABASE_TOKEN`, `HOTDATA_DATABASE_REFRESH_TOKEN`, `HOTDATA_DATABASE`, `HOTDATA_WORKSPACE`, and `HOTDATA_API_URL` injected into its environment. Pass a database id (group-positional `<id>` like `sandbox run`, or `--database <id>`) to scope an existing database; omit both to auto-create a scratch one using `--description` / `--schema` / `--table` / `--expires-at`. Useful for launching an agent or child process whose API access is restricted to a single database.
149152
- For CSV/JSON uploads without a managed database, use `hotdata datasets create` instead (`datasets.main.*`).
150153

151154
Example:

skills/hotdata/SKILL.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ hotdata databases create [--description <label>] [--table <table> ...] [--schema
191191
hotdata databases set <id_or_description>
192192
hotdata databases <id_or_description> [--workspace-id <workspace_id>] [--output table|json|yaml]
193193
hotdata databases delete <id_or_description> [--workspace-id <workspace_id>]
194+
hotdata databases run [--database <id>] [--description <label>] [--schema public] [--table <table> ...] [--expires-at <duration|timestamp>] [--workspace-id <workspace_id>] <cmd> [args...]
195+
hotdata databases <id> run <cmd> [args...]
194196
195197
# Dot-notation shorthand for load: database.table or database.schema.table
196198
hotdata databases load <database.table> [--file ./data.parquet] [--url <url>] [--upload-id <id>] [--workspace-id <workspace_id>]
@@ -209,6 +211,7 @@ hotdata databases tables delete <table> [--database <id_or_desc>] [--schema publ
209211
- `tables list` — lists tables with `TABLE` (`<database_id>.<schema>.<table>`), `SYNCED`, `LAST_SYNC`. Uses active database when `--database` is omitted.
210212
- `tables load` — uploads a local parquet file (`--file`), a remote parquet URL (`--url`), or a pre-staged upload (`--upload-id`) and publishes with **replace** mode.
211213
- `tables delete` — drops a table from the managed database.
214+
- `run` — mints a database-scoped JWT (via `POST /v1/auth/database`) and execs `<cmd>` with `HOTDATA_DATABASE_TOKEN`, `HOTDATA_DATABASE_REFRESH_TOKEN`, `HOTDATA_DATABASE`, `HOTDATA_WORKSPACE`, and `HOTDATA_API_URL` injected. Pass a database id as a group positional (`hotdata databases <id> run ...`, sandbox-style) or via `--database <id>`; omit both to auto-create a scratch database using `--description` / `--schema` / `--table` / `--expires-at`. Use this to launch an agent or child process whose API access is scoped to a single database. The minted JWT carries `database`, `workspaces`, `permissions:["read","write"]`, `source:"database_token"`. The session is persisted at `~/.hotdata/database_session.json` (mode `0600`); the child's exit code is propagated.
212215

213216
Example:
214217

0 commit comments

Comments
 (0)