Skip to content

fix(databases): use name not description for API alignment#112

Merged
eddietejeda merged 5 commits into
mainfrom
fix/database-name-not-description
May 28, 2026
Merged

fix(databases): use name not description for API alignment#112
eddietejeda merged 5 commits into
mainfrom
fix/database-name-not-description

Conversation

@eddietejeda
Copy link
Copy Markdown
Contributor

Summary

The Hotdata API renamed the database identifier field from description to name (SDK 0.2.4). This PR updates the CLI to match:

  • try_resolve_database: now filters the list by d.name instead of d.description — fixes hotdata databases get <name> against the new API
  • databases set: now accepts the database id directly rather than resolving by name/description (id is unambiguous and always available after databases create)
  • Help text & error messages: updated "id or description" → "id or name" throughout
  • Tests: mock payloads updated to return name field (not description)

Test plan

  • cargo test databases — all 24 tests pass
  • hotdata databases get <name> resolves correctly
  • hotdata databases set <id> saves config without a network round-trip

The Hotdata API renamed the database identifier field from `description`
to `name`. This updates:

- `try_resolve_database`: filter by `d.name` instead of `d.description`
  so that `hotdata databases get <name>` works against the new API
- `databases set`: accept the database id directly rather than resolving
  by name/description — the id is unambiguous and always available
- Error messages and help text: "id or description" → "id or name"
- Tests: update mock payloads to return `name` (not `description`)
Comment thread src/command.rs
Comment thread src/databases.rs
Comment thread src/databases.rs Outdated
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Blocking Issues

  • src/command.rs:577-585--table help text claims schema.table dot notation in databases create lands tables in the named schema (e.g. --table raw.raw_ordersraw schema), but create_database_request (src/databases.rs:164-173) doesn't parse the dot at all — it sends the literal string as a single table name inside the --schema value. The doc and behavior disagree, and there's no test for the claim.

Action Required

  • Either implement schema parsing in create_database_request (split on ., group tables by resolved schema) and add a test covering --table raw.raw_orders --table customers, or drop the dot-notation claim from the two --schema / --table doc comments in command.rs.

The remaining inline comments are nits and non-blocking.

@sentry
Copy link
Copy Markdown

sentry Bot commented May 27, 2026

Codecov Report

❌ Patch coverage is 66.31579% with 32 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/databases.rs 69.23% 28 Missing ⚠️
src/main.rs 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

…ase_request

The --table flag doc comments claimed that `schema.table` entries would land
in the named schema, but the implementation was sending literal strings as
table names inside a single schema. This implements the promised behavior:
entries with a dot are split into (schema, table) and grouped accordingly,
bare names fall back to the --schema default. Adds a test covering the
multi-schema case.

Also removes an extra blank line between resolve_database and schema_name.
claude[bot]
claude Bot previously approved these changes May 28, 2026
- Drop `description` field from DatabaseSummary, Database, and
  CreateDatabaseResponse structs — the API now returns `name` only
- Remove `--description` flag from `databases create` and the
  corresponding `"description"` JSON key from create_database_request
- Drop DESCRIPTION column from `databases list` table output
- Remove the always-blank `description: -` row from `databases show`
- `databases set` now resolves the input to a real db.id before saving,
  validating the database exists and ensuring the config always holds an ID
- Rename id_or_description params to id_or_name in get/delete/set
- Update all tests and the databases_cli integration test
claude[bot]
claude Bot previously approved these changes May 28, 2026
@eddietejeda eddietejeda merged commit 1d201bb into main May 28, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant