Skip to content

Commit f2b2798

Browse files
committed
fix(ux): address review feedback on catalog-ux-redesign
- Fix views.rs:194 to use v.schema_name instead of hardcoded "main" - Update command.rs doc strings: Set uses "id or name", Delete uses "name or ID" - Update README Search and Indexes sections to use --catalog/--table flags - Update hotdata skill: databases load/create syntax, fix views->datasets ref - Update hotdata-search skill: search and indexes create use --catalog/--table
1 parent 74e6bf7 commit f2b2798

5 files changed

Lines changed: 43 additions & 43 deletions

File tree

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ hotdata queries <query_run_id> [-o table|json|yaml]
229229

230230
```sh
231231
# BM25 full-text search (requires a BM25 index on the column)
232-
hotdata search "<query>" --type bm25 --table <connection.schema.table> --column <column> [--select <columns>] [--limit <n>] [-o table|json|csv]
232+
hotdata search "<query>" --type bm25 --catalog <catalog> --table <table> --column <column> [--schema <schema>] [--select <columns>] [--limit <n>] [-o table|json|csv]
233233

234234
# Vector search (requires a vector index with auto-embedding on the column)
235-
hotdata search "<query>" --type vector --table <table> --column <source_text_column> [--limit <n>]
235+
hotdata search "<query>" --type vector --catalog <catalog> --table <table> --column <source_text_column> [--schema <schema>] [--limit <n>]
236236
```
237237

238238
- **`--type vector`** — pass your query as **plain text**, name the **source text column** (e.g. `title`). The server embeds the query at the same time, using the same provider that auto-embedded the column when the index was built — so distance metric, model, and dimensions all match automatically. No `OPENAI_API_KEY`, no client-side embedding, no need to know about the auto-generated `_embedding` column. Generated SQL: `vector_distance(col, 'query')` server-side.
@@ -244,16 +244,16 @@ hotdata search "<query>" --type vector --table <table> --column <source_text_col
244244

245245
## Indexes
246246

247-
Indexes attach to either a connection-table (`--connection-id` + `--schema` + `--table`) or a dataset (`--dataset-id`). The two scopes are mutually exclusive.
247+
Indexes attach to either a catalog-table (`--catalog` + `--table`) or a dataset (`--dataset-id`). The two scopes are mutually exclusive.
248248

249249
```sh
250-
# Connection-table scope
251-
hotdata indexes list --connection-id <id> --schema <schema> --table <table> [-o table|json|yaml]
252-
hotdata indexes create --connection-id <id> --schema <schema> --table <table> \
253-
--name <name> --columns <cols> --type sorted|bm25|vector \
254-
[--metric l2|cosine|dot] [--async] \
250+
# Catalog-table scope
251+
hotdata indexes list --catalog <catalog> --table <table> [--schema <schema>] [-o table|json|yaml]
252+
hotdata indexes create --catalog <catalog> --table <table> [--schema <schema>] \
253+
--column <col> --type sorted|bm25|vector \
254+
[--name <name>] [--metric l2|cosine|dot] [--async] \
255255
[--embedding-provider-id <id>] [--dimensions <n>] [--output-column <name>] [--description <text>]
256-
hotdata indexes delete --connection-id <id> --schema <schema> --table <table> --name <name>
256+
hotdata indexes delete --catalog <catalog> --table <table> [--schema <schema>] --name <name>
257257

258258
# Dataset scope
259259
hotdata indexes list --dataset-id <id> [-o table|json|yaml]

skills/hotdata-search/SKILL.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ Retrieval workloads in Hotdata: **BM25 full-text**, **vector similarity**, and t
2020

2121
```bash
2222
# BM25 (requires a BM25 index on the column)
23-
hotdata search "<query>" --type bm25 --table <connection.schema.table> --column <column> \
24-
[--select <columns>] [--limit <n>] [--workspace-id <workspace_id>] [--output table|json|csv]
23+
hotdata search "<query>" --type bm25 --catalog <catalog> --table <table> --column <column> \
24+
[--schema <schema>] [--select <columns>] [--limit <n>] [--workspace-id <workspace_id>] [--output table|json|csv]
2525

2626
# Vector (requires a vector index; server auto-embeds the query text)
27-
hotdata search "<query>" --type vector --table <connection.schema.table> --column <source_text_column> \
28-
[--select <columns>] [--limit <n>] [--workspace-id <workspace_id>] [--output table|json|csv]
27+
hotdata search "<query>" --type vector --catalog <catalog> --table <table> --column <source_text_column> \
28+
[--schema <schema>] [--select <columns>] [--limit <n>] [--workspace-id <workspace_id>] [--output table|json|csv]
2929
```
3030

3131
| Type | Behavior |
@@ -41,22 +41,24 @@ hotdata search "<query>" --type vector --table <connection.schema.table> --colum
4141

4242
## Indexes (BM25 and vector)
4343

44-
Indexes attach to a **connection table** (`--connection-id` + `--schema` + `--table`) or a **dataset** (`--dataset-id`). Scopes are mutually exclusive for create/delete.
44+
Indexes attach to a **catalog table** (`--catalog` + `--table`) or a **dataset** (`--dataset-id`). Scopes are mutually exclusive for create/delete.
45+
46+
**Note:** `indexes create` uses `--catalog`/`--table`; `indexes list` and `indexes delete` still use `--connection-id`/`--schema`/`--table`.
4547

4648
```bash
47-
# List — workspace scan on connection tables (filter with -c / --schema / --table)
49+
# List — workspace scan (filter with --connection-id / --schema / --table)
4850
hotdata indexes list [--connection-id <id>] [--schema <schema>] [--table <table>] [--workspace-id <ws>] [--output table|json|yaml]
4951
hotdata indexes list --dataset-id <dataset_id> [--workspace-id <ws>] [--output table|json|yaml]
5052

51-
# Connection table
52-
hotdata indexes create --connection-id <id> --schema <schema> --table <table> \
53-
--name <name> --columns <cols> --type bm25|vector \
54-
[--metric l2|cosine|dot] [--async] \
53+
# Catalog table (create uses --catalog; list/delete use --connection-id)
54+
hotdata indexes create --catalog <catalog> --table <table> --column <col> --type bm25|vector \
55+
[--schema <schema>] [--name <name>] [--metric l2|cosine|dot] [--async] \
5556
[--embedding-provider-id <id>] [--dimensions <n>] [--output-column <name>] [--description <text>]
5657
hotdata indexes delete --connection-id <id> --schema <schema> --table <table> --name <name>
5758

5859
# Dataset
59-
hotdata indexes create --dataset-id <dataset_id> --name <name> --columns <cols> --type bm25|vector ...
60+
hotdata indexes create --dataset-id <dataset_id> --columns <cols> --type bm25|vector \
61+
[--name <name>] [--metric l2|cosine|dot] [--async] ...
6062
hotdata indexes delete --dataset-id <dataset_id> --name <name>
6163
```
6264

@@ -89,6 +91,6 @@ hotdata embedding-providers delete <id> [--workspace-id <workspace_id>]
8991

9092
1. `hotdata tables list --connection-id <id>` — confirm column types.
9193
2. `hotdata indexes list` — avoid duplicate indexes.
92-
3. `hotdata indexes create ... --type bm25|vector` (add `--async` if large).
93-
4. `hotdata search "..." --type bm25|vector --table ... --column ...`
94+
3. `hotdata indexes create --catalog <catalog> --table <table> --column <col> --type bm25|vector` (add `--async` if large).
95+
4. `hotdata search "..." --type bm25|vector --catalog <catalog> --table <table> --column <col>`
9496
5. Record what exists in **context:DATAMODEL** (core skill) when the workspace should remember index choices.

skills/hotdata/SKILL.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -181,42 +181,40 @@ hotdata connections create \
181181

182182
**Managed databases** are Hotdata-owned catalogs you create and populate yourself — no remote source to sync. Query them in SQL as **`<database_id>.<schema>.<table>`**. Prefer **`hotdata databases`** for this workflow.
183183

184-
**Parquet vs views:** `databases tables load` accepts **parquet only**. For SQL-query or saved-query materializations, use **`hotdata views create`**.
184+
**Parquet vs datasets:** `databases tables load` accepts **parquet only**. For SQL-query or saved-query materializations, use **`hotdata datasets create`**.
185185

186186
**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.
187187

188188
```
189189
hotdata databases list [--workspace-id <workspace_id>] [--output table|json|yaml]
190-
hotdata databases create [--description <label>] [--table <table> ...] [--schema public] [--expires-at <duration|timestamp>] [--workspace-id <workspace_id>] [--output table|json|yaml]
191-
hotdata databases set <id_or_description>
192-
hotdata databases <id_or_description> [--workspace-id <workspace_id>] [--output table|json|yaml]
193-
hotdata databases delete <id_or_description> [--workspace-id <workspace_id>]
190+
hotdata databases create [--name <name>] [--description <label>] [--table <table> ...] [--schema public] [--expires-at <duration|timestamp>] [--workspace-id <workspace_id>] [--output table|json|yaml]
191+
hotdata databases set <id_or_name>
192+
hotdata databases <id_or_name> [--workspace-id <workspace_id>] [--output table|json|yaml]
193+
hotdata databases delete <id_or_name> [--workspace-id <workspace_id>]
194194
195-
# Dot-notation shorthand for load: database.table or database.schema.table
196-
hotdata databases load <database.table> [--file ./data.parquet] [--url <url>] [--upload-id <id>] [--workspace-id <workspace_id>]
195+
hotdata databases load --table <table> [--catalog <name>] [--schema public] [--file ./data.parquet] [--url <url>] [--upload-id <id>] [--workspace-id <workspace_id>]
197196
198-
hotdata databases tables list [--database <id_or_desc>] [--schema <name>] [--workspace-id <workspace_id>] [--output table|json|yaml]
199-
hotdata databases tables load <table> [--database <id_or_desc>] [--schema public] [--file ./data.parquet] [--url <url>] [--upload-id <id>] [--workspace-id <workspace_id>]
200-
hotdata databases tables delete <table> [--database <id_or_desc>] [--schema public] [--workspace-id <workspace_id>]
197+
hotdata databases tables list [--database <id_or_name>] [--schema <name>] [--workspace-id <workspace_id>] [--output table|json|yaml]
198+
hotdata databases tables load <table> [--database <id_or_name>] [--schema public] [--file ./data.parquet] [--url <url>] [--upload-id <id>] [--workspace-id <workspace_id>]
199+
hotdata databases tables delete <table> [--database <id_or_name>] [--schema public] [--workspace-id <workspace_id>]
201200
```
202201

203202
- `list` — all managed databases in the workspace.
204-
- `create` — creates a new managed database. `--description` is an optional human-readable label (databases are addressed by id, not description). `--expires-at` accepts relative durations (`24h`, `7d`, `90m`) or an RFC 3339 timestamp; defaults to `24h` when omitted. Repeat `--table` to declare tables up front.
205-
- `set` — saves `<id_or_description>` as the active database. Subsequent `databases tables` and `context` commands use it automatically.
206-
- `<id_or_description>` — inspect one database (id, description, expires_at).
203+
- `create` — creates a new managed database. `--name` sets the SQL catalog alias used in queries (`SELECT … FROM <name>.public.<table>`); must be `[a-z_][a-z0-9_]*`, globally unique, and omitting it means no expiry default. `--description` is an optional display label. `--expires-at` accepts relative durations (`24h`, `7d`, `90m`) or an RFC 3339 timestamp; defaults to `24h` when `--name` is omitted. Repeat `--table` to declare tables up front.
204+
- `set` — saves `<id_or_name>` as the active database. Subsequent `databases tables` and `context` commands use it automatically.
205+
- `<id_or_name>` — inspect one database (id, name, expires_at).
207206
- `delete` — removes the managed database; clears the active-database config if it matched.
208-
- `load`shorthand with dot notation (`database.table` or `database.schema.table`). Schema defaults to `public`.
207+
- `load`loads a parquet file into a table. `--catalog` selects the database by name; defaults to the current database set via `databases set`. Schema defaults to `public`.
209208
- `tables list` — lists tables with `TABLE` (`<database_id>.<schema>.<table>`), `SYNCED`, `LAST_SYNC`. Uses active database when `--database` is omitted.
210209
- `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.
211210
- `tables delete` — drops a table from the managed database.
212211

213212
Example:
214213

215214
```
216-
hotdata databases create --description "sales" --table orders
217-
hotdata databases set <returned-id>
218-
hotdata databases tables load orders --file ./orders.parquet
219-
hotdata query "SELECT count(*) FROM <database_id>.public.orders"
215+
hotdata databases create --name sales --table orders
216+
hotdata databases load --catalog sales --table orders --file ./orders.parquet
217+
hotdata query "SELECT count(*) FROM sales.public.orders"
220218
```
221219

222220
### List Tables and Columns

src/command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,13 +602,13 @@ pub enum DatabasesCommands {
602602

603603
/// Set the current database (used by default when no database is specified)
604604
Set {
605-
/// Database id or description
605+
/// Database id or name
606606
id_or_description: String,
607607
},
608608

609609
/// Delete a managed database and its tables
610610
Delete {
611-
/// Database name or connection ID
611+
/// Database name or ID
612612
name_or_id: String,
613613
},
614614

src/views.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub fn get(view_id: &str, workspace_id: &str, format: &str) {
191191
let updated_at = crate::util::format_date(&v.updated_at);
192192
println!("id: {}", v.id);
193193
println!("label: {}", v.label);
194-
println!("full_name: views.main.{}", v.table_name);
194+
println!("full_name: views.{}.{}", v.schema_name, v.table_name);
195195
println!("source_type: {}", v.source_type);
196196
println!("created_at: {created_at}");
197197
println!("updated_at: {updated_at}");

0 commit comments

Comments
 (0)