fsprojects / FSharp.AWS.DynamoDB

F# wrapper API for AWS DynamoDB
MIT License
58 stars 18 forks source link

Allow empty strings #79

Closed purkhusid closed 3 weeks ago

purkhusid commented 2 months ago

What?

DynamoDB has supported empty strings for non-key attributes since mid 2020: https://aws.amazon.com/about-aws/whats-new/2020/05/amazon-dynamodb-now-supports-empty-values-for-non-key-string-and-binary-attributes-in-dynamodb-tables/

samritchie commented 2 months ago

I think this is good in principle, but just unsure what the behaviour with key attributes should be - if the SDK throws an exception or (more likely but less preferable) AWS returns a sensible error response. Can we get a couple of tests for that?

Another option might be trapping empty strings in the TableKey factory methods (there are just null checks there now) - I think that would cover off all the scenarios we care about.

purkhusid commented 2 months ago

Another option might be trapping empty strings in the TableKey factory methods (there are just null checks there now) - I think that would cover off all the scenarios we care about.

Good thinking, I'll add the tests and validation in the TableKey.

purkhusid commented 2 months ago

@samritchie Added tests for empty strings in key values. Decided not to do the validation in this library since the error from the DynamoDB client is good.