Skip to content

Commit dcf53f3

Browse files
committed
Add skill writeup for datasets commands and show full_name in table details for datasets
1 parent 4dffa69 commit dcf53f3

2 files changed

Lines changed: 46 additions & 6 deletions

File tree

skills/hotdata-cli/SKILL.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: hotdata-cli
3-
description: Use this skill when the user wants to run hotdata CLI commands, query the HotData API, list workspaces, list connections, list tables, execute SQL queries, or interact with the hotdata service. Activate when the user says "run hotdata", "query hotdata", "list workspaces", "list connections", "list tables", "execute a query", 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, list tables, manage datasets, execute SQL queries, or interact with the hotdata service. Activate when the user says "run hotdata", "query hotdata", "list workspaces", "list connections", "list tables", "list datasets", "create a dataset", "upload a dataset", "execute a query", or asks you to use the hotdata CLI.
44
version: 0.1.3
55
---
66

@@ -50,6 +50,46 @@ hotdata tables list [--workspace-id <workspace_id>] [--connection-id <connection
5050
- `--schema` and `--table` support SQL `%` wildcard patterns (e.g. `--table order%` matches `orders`, `order_items`, etc.).
5151
- Results are paginated (default 100 per page). If more results are available, a `--cursor` token is printed — pass it to fetch the next page.
5252

53+
### Datasets
54+
55+
Datasets are managed files uploaded to HotData and queryable as tables.
56+
57+
#### List datasets
58+
```
59+
hotdata datasets list [--workspace-id <workspace_id>] [--limit <int>] [--offset <int>] [--format table|json|yaml]
60+
```
61+
- Default format is `table`.
62+
- Returns `id`, `label`, `table_name`, `created_at`.
63+
- Results are paginated (default 100). Use `--offset` to fetch further pages.
64+
65+
#### Get dataset details
66+
```
67+
hotdata datasets <dataset_id> [--workspace-id <workspace_id>] [--format table|json|yaml]
68+
```
69+
- Shows dataset metadata and a full column listing with `name`, `data_type`, `nullable`.
70+
- Use this to inspect schema before querying.
71+
72+
#### Create a dataset
73+
```
74+
hotdata datasets create --label "My Dataset" --file data.csv [--table-name my_dataset] [--workspace-id <workspace_id>]
75+
```
76+
- `--file` uploads a local file. Omit to pipe data via stdin: `cat data.csv | hotdata datasets create --label "My Dataset"`
77+
- Format is auto-detected from file extension (`.csv`, `.json`, `.parquet`) or file content.
78+
- `--label` is optional when `--file` is provided — defaults to the filename without extension.
79+
- `--table-name` is optional — derived from the label if omitted.
80+
81+
#### Querying datasets
82+
83+
Datasets are queryable using the catalog `datasets` and schema `main`. Always reference dataset tables as:
84+
```
85+
datasets.main.<table_name>
86+
```
87+
For example:
88+
```
89+
hotdata query "SELECT * FROM datasets.main.my_dataset LIMIT 10"
90+
```
91+
Use `hotdata datasets <dataset_id>` to look up the `table_name` before writing queries.
92+
5393
### Execute SQL Query
5494
```
5595
hotdata query "<sql>" [--workspace-id <workspace_id>] [--connection <connection_id>] [--format table|json|csv]

src/datasets.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ pub fn create(
319319
println!("{}", "Dataset created".green());
320320
println!("id: {}", dataset.id);
321321
println!("label: {}", dataset.label);
322-
println!("table_name: {}", dataset.table_name);
322+
println!("full_name: datasets.main.{}", dataset.table_name);
323323
}
324324

325325
pub fn list(workspace_id: &str, limit: Option<u32>, offset: Option<u32>, format: &str) {
@@ -378,13 +378,14 @@ pub fn list(workspace_id: &str, limit: Option<u32>, offset: Option<u32>, format:
378378
"yaml" => print!("{}", serde_yaml::to_string(&body.datasets).unwrap()),
379379
"table" => {
380380
let mut table = crate::util::make_table();
381-
table.set_header(["ID", "LABEL", "TABLE NAME", "CREATED AT"]);
381+
table.set_header(["ID", "LABEL", "FULL NAME", "CREATED AT"]);
382382
table.column_mut(1).unwrap().set_constraint(
383383
comfy_table::ColumnConstraint::UpperBoundary(comfy_table::Width::Fixed(30))
384384
);
385385
for d in &body.datasets {
386386
let created_at = d.created_at.split('.').next().unwrap_or(&d.created_at).replace('T', " ");
387-
table.add_row([&d.id, &d.label, &d.table_name, &created_at]);
387+
let full_name = format!("datasets.main.{}", d.table_name);
388+
table.add_row([&d.id, &d.label, &full_name, &created_at]);
388389
}
389390
println!("{table}");
390391
if body.has_more {
@@ -452,8 +453,7 @@ pub fn get(dataset_id: &str, workspace_id: &str, format: &str) {
452453
let updated_at = d.updated_at.split('.').next().unwrap_or(&d.updated_at).replace('T', " ");
453454
println!("id: {}", d.id);
454455
println!("label: {}", d.label);
455-
println!("schema: {}", d.schema_name);
456-
println!("table: {}", d.table_name);
456+
println!("full_name: datasets.main.{}", d.table_name);
457457
println!("source_type: {}", d.source_type);
458458
println!("created_at: {created_at}");
459459
println!("updated_at: {updated_at}");

0 commit comments

Comments
 (0)