Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PK and SK interfaces (along with gsi's) only allows string keys #2

Closed
ghbuck opened this issue Nov 1, 2023 · 3 comments
Closed

PK and SK interfaces (along with gsi's) only allows string keys #2

ghbuck opened this issue Nov 1, 2023 · 3 comments
Assignees

Comments

@ghbuck
Copy link

ghbuck commented Nov 1, 2023

Whereas Dynamo allows two other types:

image

Could we update to allow all three available key types?

Thanks!

@mikebroberts
Copy link
Member

Thanks! I'll take a look to see whether I can do this fairly simply and not make typing too loose in the cases where a string is being used.

@mikebroberts mikebroberts self-assigned this Nov 6, 2023
@ghbuck
Copy link
Author

ghbuck commented Nov 6, 2023

FWIW I simply added | number to pk and sk in Entity and GsiGenerators. It works for what I need. The check for a binary type would be more involved, I would assume.

mikebroberts added a commit that referenced this issue Nov 12, 2023
PK and SK values can be any _scalar_ value, not just strings.

Therefore change return type of PK, SK, and GSI PK + SK, generator functions to `NativeScalarAttributeValue`

Thanks to @ghbuck for issue #2
@mikebroberts
Copy link
Member

Fixed in v1.1.0 . I noticed that there was a useful type in the DynamoDB library that could handle this. Thanks again.

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

No branches or pull requests

2 participants