Skip to content

feat(tables): add constant-per-key configuration support - #129

Open
hotdata-automation[bot] wants to merge 1 commit into
mainfrom
openapi-update-33722774701
Open

feat(tables): add constant-per-key configuration support#129
hotdata-automation[bot] wants to merge 1 commit into
mainfrom
openapi-update-33722774701

Conversation

@hotdata-automation

Copy link
Copy Markdown
Contributor

Auto-generated from the updated HotData OpenAPI spec.
Source: https://github.com/hotdata-dev/www/pull/409

@hotdata-automation
hotdata-automation Bot requested a review from a team as a code owner September 3, 2026 06:21
@hotdata-automation
hotdata-automation Bot requested review from anoop-narang and removed request for a team September 3, 2026 06:21
@hotdata-automation
hotdata-automation Bot enabled auto-merge (squash) September 3, 2026 06:21
Comment thread CHANGELOG.md

### Changed

- feat(tables): add constant-per-key configuration support

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Record the breaking removal of key_determines. Add a ### Removed entry marked **Breaking:**, matching the 0.15.0 entries at CHANGELOG.md lines 41-57.

Release 0.15.0 shipped key_determines on the managed-table declaration models (CHANGELOG.md line 29). This regen renames that field to constant_per_key, adds a required constant_per_key field to TableInfo, and adds a parameter to TableInfo::new. All three changes break downstream compilation.

Failure scenario: a maintainer reads the current note, sees an added feature only, and runs ./scripts/release.sh prepare patch. Version 0.15.1 reaches crates.io. A consumer that sets decl.key_determines = Some(cols) upgrades inside the 0.15 range and fails to compile. No changelog entry explains the break. A crates.io publish is immutable, so the release cannot be corrected in place.

}

/// Replace the columns a table declares constant for a given key: for every row, any other row sharing its key holds the same value of these columns. Declaring this lets a keyed mutation (`delete`, `update`, `upsert`) narrow its search for prior versions to the values the upload carries, which prunes far harder than the key alone when the key's own file statistics do not discriminate. Unlike `partition_by` and `sorted_by`, this is NOT fixed when the table is created. It changes only which files a mutation opens, never how rows are written, so nothing stored becomes wrong when it changes and a populated table can adopt it with no rewrite. It takes effect on the next load. Send an empty array to revoke it, restoring the unrestricted search — this is the way to undo a declaration that turns out to be false. **This is correctness-affecting, not a hint.** If the assertion is false, a keyed mutation supersedes one version of a key and appends beside another, silently duplicating it, and the pruning conceals its own evidence because the file holding the missed row is never opened. Declare it only where the invariant is established.
pub async fn set_managed_table_constant_per_key(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: no ergonomic wrapper covers either new endpoint (not blocking). src/resources.rs wraps the sibling managed-table operations load_managed_table and delete_managed_table, so a caller on client.connections() cannot reach the constant-per-key write and must call hotdata::apis::connections_api directly. Add wrappers for both new operations in a follow-up.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review

Blocking Issues

  • CHANGELOG.md line 12: the note records an added feature only. This regen also removes key_determines, which release 0.15.0 shipped one day ago (CHANGELOG.md line 29), and changes the TableInfo::new signature. Both changes break downstream crates.

Action Required

  • Add a ### Removed entry under the Unreleased heading, marked **Breaking:**. Name the key_determines to constant_per_key rename on AddManagedTableDecl, AddManagedTableRequest and DatabaseDefaultTableDecl, the new required TableInfo.constant_per_key field, and the new TableInfo::new parameter. Follow the format of the 0.15.0 entries at CHANGELOG.md lines 41-57.
  • Ship the change in a minor release, not a patch release.

Notes

  • The generated code matches the repository templates. No other code references key_determines or constructs TableInfo, so the rename orphans nothing.
  • The Integration Tests / integration check was still pending at review time. Compilation is unverified here.

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.

0 participants