fix(tables): send --key-determines as constant_per_key - #316
Merged
Merged
Conversation
runtimedb #1300 renamed the table declaration field from key_determines to constant_per_key, and the add-table request rejects unknown fields. The CLI still sent the old name, so `tables add --key-determines` got a 400. Send constant_per_key. The flag keeps its name. Move the body into table_declaration_body so the wire name is unit-tested.
shefeek-jinnah
requested review from
rohan-hotdata
and removed request for
a team
September 23, 2026 11:25
| } | ||
|
|
||
| /// `databases tables add` — declare a table on an existing instant database. | ||
| /// Build the request body for `POST /v1/databases/{id}/schemas/{schema}/tables`, |
Contributor
There was a problem hiding this comment.
super nit: add_table lost its doc comment (not blocking). The sentence on line 960 describes the databases tables add command, so it now sits on the wrong function. Move that sentence back above add_table.
Contributor
Author
There was a problem hiding this comment.
Fixed in de0e182. The sentence is back above add_table.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hotdata databases tables add --key-determines <col>is rejected by the server today.key_determinestoconstant_per_key.AddManagedTableRequesthasdeny_unknown_fieldsand no alias for the old name, but the CLI still sent"key_determines", so the request got a 400.constant_per_key. The--key-determinesflag keeps its name, so nothing changes for users.table_declaration_body, so a unit test can check the field name.The CLI builds this body as raw JSON rather than through the SDK, so the SDK version doesn't matter here. This PR doesn't depend on #315.
Test plan
cargo test: 597 passed, including the newtable_declaration_body_sends_key_determines_as_constant_per_keycargo clippy --all-targets -- -D warningsandcargo fmt --checktables add --key <col> --key-determines <col>against a live server