taoensso / faraday

Amazon DynamoDB client for Clojure
https://www.taoensso.com/faraday
Eclipse Public License 1.0
238 stars 84 forks source link

Support for new types and basic conditions #48

Closed tcoupland closed 9 years ago

tcoupland commented 9 years ago

I've added tests for the new types and added support for the most basic of condition tests.

The main thing of note is a breaking change to use of 'false' to denote a nonexistent column. Now that Boolean types have been added this just doesn't work, so the keywords :exists and :not-exist have been added to the update function. The simple conditions have been added as a vector of [op val] to update as well.

ptaoussanis commented 9 years ago

Hi Tom, thanks (and happy near year!). Will be back at work on Monday - will try take a look at this in detail then.

In the meantime, would be helpful if you could just recap what the current changes/objectives are with this PR. Am juggling a lot of stuff atm and not using Faraday myself so the clearer a PR, the more likely I can just hit merge.

An extra commit that updates the CHANGELOG.md would be perfect. You can just use "SNAPSHOT / unreleased" for the version title.

Thanks again! Cheers :-)

tcoupland commented 9 years ago

Hi Peter,

Happy new year to you to! Hope you had a good holiday break.

I think the contentious part of my addition are the :exists and :not-exists flags to the update-item function. The only thing this breaks is that :expected false would have checked if the attribute existed, now this will check if the value of the attribute is false. I think this is the least breaking way to introduce the Boolean type here, as it allows any :expected <value> calls (checking for equality) to remain as they are.

Other than that i've really just added some tests for the new types that were already present in the code (fixing one little issue along the way) and allowed local testing.

ptaoussanis commented 9 years ago

This looks great, thanks a lot Tom! Sorry for the delay getting this merged - have been working through a bit of a backlog after the new year.