Skip to content

Commit 1bdadc6

Browse files
authored
feat(ingest): rename the catalog verb connectors -> datasources (#216)
'hotdata ingest datasources' now browses the catalog of available datasource types; 'connectors' stays as a hidden alias. Help, error hints, README, and the skill follow. Co-authored-by: Eddie A Tejeda <669988+eddietejeda@users.noreply.github.com>
1 parent 260b3e5 commit 1bdadc6

3 files changed

Lines changed: 17 additions & 15 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Pull data from SQL databases, APIs, S3/GCS/Azure buckets, or Iceberg catalogs
8484
into a managed database:
8585

8686
```sh
87-
hotdata ingest connectors # browse: SQL dialects, ~150 API services,
87+
hotdata ingest datasources # browse: SQL dialects, ~150 API services,
8888
# buckets, iceberg, api (bring-your-own)
8989

9090
# Add a datasource — validates credentials and discovers the schema, loads no data.

‎skills/hotdata/SKILL.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,8 @@ Pull data from external sources (SQL databases, APIs, S3/GCS/Azure buckets, Iceb
302302
Commands that create or change things (`new-datasource`, `new-import`, `trigger-import`, `delete-datasource`) **require a workspace API key** (`HOTDATA_API_KEY` / `--api-key`, `hd_...`); a login session is not accepted.
303303

304304
```bash
305-
hotdata ingest connectors [filter] # browse the catalog; "added" = you have a
306-
# datasource for it. SQL dialects + ~150 named
305+
hotdata ingest datasources [filter] # browse available datasource types; "added" =
306+
# you already have one. SQL dialects + ~150 named
307307
# API services + generic buckets / iceberg / api.
308308
# -o json includes each entry's config_schema —
309309
# the exact fields --config takes.
@@ -323,7 +323,7 @@ hotdata ingest new-datasource --service buckets --bucket-url s3://bucket/prefix
323323
hotdata ingest new-datasource --service iceberg --config @catalog.json --table ns.orders
324324
# Iceberg via a REST catalog. --table is REQUIRED (repeatable, namespace.table).
325325
# catalog.json fields: {"uri": …, "warehouse": …, "token": …} or "credential" +
326-
# "scope" for an OAuth exchange — see the iceberg config_schema in `connectors -o json`.
326+
# "scope" for an OAuth exchange — see the iceberg config_schema in `datasources -o json`.
327327

328328
hotdata ingest list-datasources # names, ids, statuses; --all includes replaced ones
329329
hotdata ingest show-datasource <id> # status + discovered tables/columns

‎src/commands/ingest.rs‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
//! Two nouns, named explicitly in every command: **datasources** (added,
44
//! credentialed sources — schema discovered, no data loaded) and **imports**
55
//! (managed DBs materialized from a datasource). Commands: `new-datasource`,
6-
//! `list-datasources`, `connectors` (the catalog), `new-import` (--all or
6+
//! `list-datasources`, `datasources` (the catalog of available types),
7+
//! `new-import` (--all or
78
//! SQL), `list-imports`, `trigger-import` (re-run: refresh an import's DB
89
//! from source), `status` (one-shot or `--wait` attach). The 0.13
910
//! `*-connection` verbs survive as hidden aliases (the noun collided with
@@ -91,7 +92,7 @@ pub enum IngestCommands {
9192
///
9293
/// Interactive by default; pass `--service` with config flags to add
9394
/// non-interactively. Pull rows separately with `hotdata ingest
94-
/// new-import`; browse connectors with `hotdata ingest connectors`.
95+
/// new-import`; browse available types with `hotdata ingest datasources`.
9596
#[command(alias = "new-connection")]
9697
NewDatasource {
9798
#[command(flatten)]
@@ -130,9 +131,10 @@ pub enum IngestCommands {
130131
all: bool,
131132
},
132133

133-
/// Browse the connector catalog
134-
Connectors {
135-
/// Filter to connectors whose name contains this text
134+
/// Browse the catalog of available datasource types
135+
#[command(alias = "connectors")]
136+
Datasources {
137+
/// Filter to entries whose name contains this text
136138
name: Option<String>,
137139
},
138140

@@ -231,7 +233,7 @@ pub fn dispatch(workspace_id: &str, output: &str, command: IngestCommands) {
231233
delete_datasource(workspace_id, output, &id, keep_database)
232234
}
233235
IngestCommands::ListDatasources { all } => list_datasources(workspace_id, output, all),
234-
IngestCommands::Connectors { name } => catalog_list(workspace_id, name.as_deref(), output),
236+
IngestCommands::Datasources { name } => catalog_list(workspace_id, name.as_deref(), output),
235237
IngestCommands::NewImport {
236238
sql,
237239
all,
@@ -623,7 +625,7 @@ pub struct CreateArgs {
623625
name: Option<String>,
624626

625627
/// Connector config as JSON (inline, @file.json, or @-). Field reference:
626-
/// `hotdata ingest connectors -o json` (each entry's config_schema)
628+
/// `hotdata ingest datasources -o json` (each entry's config_schema)
627629
#[arg(long)]
628630
config: Option<String>,
629631

@@ -676,7 +678,7 @@ fn add_from_flags(workspace_id: &str, output: &str, args: CreateArgs, wait: &Wai
676678
let Some(service) = args.service.as_deref() else {
677679
eprintln!(
678680
"error: --service is required to add a datasource non-interactively. \
679-
Browse connectors with 'hotdata ingest connectors', or run \
681+
Browse available types with 'hotdata ingest datasources', or run \
680682
'hotdata ingest new-datasource' in a terminal for the guided wizard."
681683
);
682684
std::process::exit(1);
@@ -688,7 +690,7 @@ fn add_from_flags(workspace_id: &str, output: &str, args: CreateArgs, wait: &Wai
688690
.find(|c| c.name == service)
689691
.cloned()
690692
.unwrap_or_else(|| {
691-
eprintln!("error: unknown connector '{service}'. Run 'hotdata ingest connectors'.");
693+
eprintln!("error: unknown connector '{service}'. Run 'hotdata ingest datasources'.");
692694
std::process::exit(1);
693695
});
694696

@@ -1512,7 +1514,7 @@ fn delete_datasource(workspace_id: &str, output: &str, id: &str, keep_database:
15121514
// --- catalog fetch --------------------------------------------------------
15131515

15141516
fn fetch_catalog(client: &IngestClient) -> Vec<ConnectorEntry> {
1515-
with_spinner("loading connectors…", || client.connectors()).connectors
1517+
with_spinner("loading datasource types…", || client.connectors()).connectors
15161518
}
15171519

15181520
/// Bare `api` connector: build a minimal API config interactively
@@ -1564,7 +1566,7 @@ fn filesystem_credentials() -> serde_json::Value {
15641566

15651567
/// Iceberg catalog connection config: prompt for catalog URI + warehouse +
15661568
/// token + namespace. Field reference: the `iceberg` entry's config_schema
1567-
/// in `hotdata ingest connectors -o json`.
1569+
/// in `hotdata ingest datasources -o json`.
15681570
fn iceberg_catalog_config() -> serde_json::Value {
15691571
let mut m = serde_json::Map::new();
15701572
m.insert("uri".into(), ask_text("Catalog URI:").into());

0 commit comments

Comments
 (0)