-
Notifications
You must be signed in to change notification settings - Fork 107
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
Maybe
and empty list/set to DynamoDB
#187
Comments
So I see we are aware of this already. Is there a reason to not do this? |
CC @ozataman |
So this is interesting. Apparently you CAN put
yet...
...since you can't make the hash-key or the range-key I would guess this means we CAN use |
Ok, so I tried this and it CAN be done, but I think it makes the interface kind of confusing. Essentially, people would see "Null: True" or simply a missing field when they enter an empty value or a Maybe. This is can be confusing since you would expect something to show up in Dynamo, yet nothing shows up or the confusing "Null: true" shows up. Additionally, the behavior of I think the best option would be to have another Additionally, we could add some types: |
Have you guys given any more thought to |
At the moment, it is possible to pass an empty list or set when encoding items. Of course empty sets, lists and strings aren't allowed in DynamoDB and such requests will fail.
Currently we are getting around this by using a specialized version of
item
andattr
that work on Maybes; empty lists, sets and strings are converted to Maybes andNothing
is simply removed from the list (since Dynamo is fine with missing fields).I noticed that a
DNull
case was added toDValue
. Nulls can't be passed as values to Dynamo but maybe another field calledDEmpty
? Then use this field forNothing
and empty lists and sets. Then we could pattern match on it and remove it out of the final request.The text was updated successfully, but these errors were encountered: