Medium/dynamite

getItem requires range key

Closed this issue · 3 comments

I have a table that has a hashKey (userId), but no range key. I want to retrieve the user by userId, but I'm getting an error that Range Key is required.

just following up. Wondering if this is in error on my part or something that dynamite doesn't support. If it doesn't support it, would you be open to a pull request?

sorry, was on vacation.

yeah, dynamite does not currently support tables with a hash-only primary key.

I'd be open to a pull-request for this.

We've been thinking about doing a more general API where you could describe table constraints, and dynamite could type-check your API calls (e.g., whether a range key is required, what the available fields are, etc). so maybe the default behavior should be to not check constraints, and we can do the required/not-required range-key check as part of the constraints API (when we decide to build such a thing)

This seems to be fixed now.