FSharp.AWS.DynamoDB icon indicating copy to clipboard operation
FSharp.AWS.DynamoDB copied to clipboard

Allow empty strings

Open purkhusid opened this issue 1 year ago • 3 comments

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/

purkhusid avatar Aug 29 '24 09:08 purkhusid

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.

samritchie avatar Aug 29 '24 11:08 samritchie

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 avatar Aug 29 '24 11:08 purkhusid

@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.

purkhusid avatar Sep 05 '24 15:09 purkhusid