Skip to content

Commit e129fcb

Browse files
committed
docs(skill): document managed databases commands.
Add databases command reference, activation triggers, chain workflow, and parquet load workflow to the bundled hotdata skill.
1 parent 1cbd751 commit e129fcb

1 file changed

Lines changed: 58 additions & 3 deletions

File tree

skills/hotdata/SKILL.md

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: hotdata
3-
description: Use this skill when the user wants to run hotdata CLI commands, query the Hotdata API, list workspaces, list connections, create connections, list tables, manage datasets, execute SQL queries, inspect query run history, search tables, manage indexes, manage sandboxes, manage workspace context and stored docs such as context:DATAMODEL via the context API (`hotdata context`), install or update the bundled agent skills (`hotdata skills`), generate shell completions (`hotdata completions`), or interact with the hotdata service. Activate when the user says "run hotdata", "query hotdata", "list workspaces", "list connections", "create a connection", "list tables", "list datasets", "create a dataset", "upload a dataset", "execute a query", "search a table", "list indexes", "create an index", "list query runs", "list past queries", "query history", "list sandboxes", "create a sandbox", "run a sandbox", "workspace context", "pull context", "push context", "data model", "context:DATAMODEL", or asks you to use the hotdata CLI.
3+
description: Use this skill when the user wants to run hotdata CLI commands, query the Hotdata API, list workspaces, list connections, create connections, list or create managed databases, load parquet into database tables, list tables, manage datasets, execute SQL queries, inspect query run history, search tables, manage indexes, manage sandboxes, manage workspace context and stored docs such as context:DATAMODEL via the context API (`hotdata context`), install or update the bundled agent skills (`hotdata skills`), generate shell completions (`hotdata completions`), or interact with the hotdata service. Activate when the user says "run hotdata", "query hotdata", "list workspaces", "list connections", "create a connection", "list databases", "create a database", "managed database", "load parquet", "list tables", "list datasets", "create a dataset", "upload a dataset", "execute a query", "search a table", "list indexes", "create an index", "list query runs", "list past queries", "query history", "list sandboxes", "create a sandbox", "run a sandbox", "workspace context", "pull context", "push context", "data model", "context:DATAMODEL", or asks you to use the hotdata CLI.
44
version: 0.2.2
55
---
66

@@ -73,14 +73,14 @@ These are **patterns** built from the commands below—not separate CLI subcomma
7373

7474
- **Model (`context:DATAMODEL`)** — The **shared** Markdown semantic map of the workspace (entities, keys, joins across connections). **Store and read it only via workspace context** (`hotdata context list`, then `hotdata context show DATAMODEL` **only when listed**, `context push DATAMODEL`); refresh using `connections`, `connections refresh`, `tables list`, and `datasets list`. For a **deep** pass (connector enrichment, indexes, per-table detail), see [references/MODEL_BUILD.md](references/MODEL_BUILD.md). Contrast **analysis modeling** in sandboxes or chat (see [Analysis modeling vs context:DATAMODEL](#analysis-modeling-vs-contextdatamodel)).
7575
- **History** — Inspect prior activity via `hotdata queries list` (query runs) and `hotdata results list` / `results <id>` (row data).
76-
- **Chain** — Follow-ups via **`datasets create`** then `query` against `datasets.<schema>.<table>`.
76+
- **Chain** — Follow-ups via **`datasets create`** then `query` against `datasets.<schema>.<table>`, or via **`databases create`** + **`databases tables load`** (parquet) then `query` against `<database>.<schema>.<table>`.
7777
- **Indexes** — Review SQL and schema, compare to existing indexes, create **sorted**, **bm25**, or **vector** indexes when it clearly helps; see [references/WORKFLOWS.md](references/WORKFLOWS.md#indexes).
7878

7979
Full step-by-step procedures: [references/WORKFLOWS.md](references/WORKFLOWS.md).
8080

8181
## Available Commands
8282

83-
Top-level subcommands (each detailed below): **`auth`**, **`datasets`**, **`query`**, **`workspaces`**, **`connections`**, **`tables`**, **`skills`**, **`results`**, **`jobs`**, **`indexes`**, **`embedding-providers`**, **`search`**, **`queries`**, **`sandbox`**, **`context`**, **`completions`**.
83+
Top-level subcommands (each detailed below): **`auth`**, **`datasets`**, **`query`**, **`workspaces`**, **`connections`**, **`databases`**, **`tables`**, **`skills`**, **`results`**, **`jobs`**, **`indexes`**, **`embedding-providers`**, **`search`**, **`queries`**, **`sandbox`**, **`context`**, **`completions`**.
8484

8585
Global CLI options: **`--api-key`**, **`-v` / `--version`**, **`-h` / `--help`**. Hidden developer flag: **`--debug`** (verbose HTTP logs).
8686

@@ -167,6 +167,43 @@ hotdata connections create \
167167
- Fields with `"type": "array"` must be JSON arrays (e.g. `"spreadsheet_ids": ["abc", "def"]`).
168168
- Nested `oneOf` fields must be a JSON object including a `"type"` discriminator field matching the chosen variant's `const` value.
169169

170+
### Managed databases (`databases`)
171+
172+
**Managed databases** are Hotdata-owned catalogs (`source_type: managed`) you create and populate yourself—no remote source to sync. Query them in SQL as **`<database_name>.<schema>.<table>`** (the database name is the connection name). Prefer **`hotdata databases`** over **`hotdata connections create --type managed`** for this workflow.
173+
174+
**Parquet vs datasets:** `databases tables load` accepts **parquet only**. For CSV/JSON uploads without a managed database, use **`hotdata datasets create`**.
175+
176+
**Declare tables at create time:** On the current API, each table must be declared with **`--table`** when creating the database before **`tables load`** will succeed. If load fails with *not declared*, recreate with `--table` or add declaration support when the API allows it.
177+
178+
```
179+
hotdata databases list [--workspace-id <workspace_id>] [--output table|json|yaml]
180+
hotdata databases create --name <name> [--table <table> ...] [--schema public] [--workspace-id <workspace_id>] [--output table|json|yaml]
181+
hotdata databases <name_or_id> [--workspace-id <workspace_id>] [--output table|json|yaml]
182+
hotdata databases delete <name_or_id> [--workspace-id <workspace_id>]
183+
184+
hotdata databases tables list <database> [--schema <name>] [--workspace-id <workspace_id>] [--output table|json|yaml]
185+
hotdata databases tables load <database> <table> --file ./data.parquet [--schema public] [--workspace-id <workspace_id>]
186+
hotdata databases tables load <database> <table> --upload-id <id> [--schema public] [--workspace-id <workspace_id>]
187+
hotdata databases tables delete <database> <table> [--schema public] [--workspace-id <workspace_id>]
188+
```
189+
190+
- `list` — managed databases only (filters `source_type: managed` from connections).
191+
- `create` — registers a managed connection with optional `config.schemas[].tables[]` from repeated **`--table`**. Default schema is **`public`**.
192+
- `<name_or_id>` — inspect one database (name, id, table counts, SQL prefix hint).
193+
- `delete` — removes the managed database and its tables.
194+
- `tables list` — tables with `TABLE` (`<database>.<schema>.<table>`), `SYNCED`, `LAST_SYNC` (via `information_schema`).
195+
- `tables load` — uploads a local **parquet** file (or uses **`--upload-id`** from a prior `POST /v1/files` staging) and publishes with **`replace`** mode. **`--file`** and **`--upload-id`** are mutually exclusive.
196+
- `tables delete` — drops a table from the managed database.
197+
- Resolving by **name** or **connection id** works for all subcommands that take `<database>` or `<name_or_id>`. Non-managed connections error with a hint to use **`hotdata connections`**.
198+
199+
Example:
200+
201+
```
202+
hotdata databases create --name sales --table orders
203+
hotdata databases tables load sales orders --file ./orders.parquet
204+
hotdata query "SELECT count(*) FROM sales.public.orders"
205+
```
206+
170207
### List Tables and Columns
171208
```
172209
hotdata tables list [--workspace-id <workspace_id>] [--connection-id <connection_id>] [--schema <pattern>] [--table <pattern>] [--limit <int>] [--cursor <cursor>] [--output table|json|yaml]
@@ -499,6 +536,24 @@ Use a sandbox to explore tables and capture **analysis-oriented** notes in sandb
499536
hotdata query "SELECT \"CustomerName\" FROM datasets.main.my_csv LIMIT 10"
500537
```
501538

539+
## Workflow: Creating a managed database (parquet)
540+
541+
1. Create the database and declare tables up front:
542+
```
543+
hotdata databases create --name mydb --table events --table users
544+
```
545+
2. Load parquet into each table:
546+
```
547+
hotdata databases tables load mydb events --file ./events.parquet
548+
```
549+
3. Confirm tables and query:
550+
```
551+
hotdata databases tables list mydb
552+
hotdata query "SELECT * FROM mydb.public.events LIMIT 10"
553+
```
554+
555+
For CSV/JSON file uploads, use **`hotdata datasets create`** instead.
556+
502557
## Workflow: Creating a Connection
503558

504559
1. List available connection types:

0 commit comments

Comments
 (0)