This repository has been archived by the owner. It is now read-only.
Asynchronous DynamoDB client for Clojure & Clojurescript/Node
Clone or download
moea Fix tests (#26)
* Update travis.yml

* 0.4.6-SNAPSHOT
Latest commit 3a29115 Sep 25, 2017

README.md

Hildebrand Build Status

Clojars Project

Hildebrand is a high-level client for Amazon's Dynamo DB, built on top of Eulalie.

Documentation

  • The API introduction on the wiki is a good place to start.
  • Introducing Hildebrand, a blog post, has a bunch of usage examples in it. The namespace layout has changed since (hildebrand -> hildebrand.core)

Examples

Querying

(require '[hildebrand.channeled :refer [query!]])

(async/into []
  (query! creds :games
          {:user-id [:= "moea"]}
          {:filter [:< [:score] 50]
           :sort :desc
           :limit 10}
          {:chan (async/chan 10 (map :score))}))
;; => [15 10]

Querying + Batched Deletes

(require '[hildebrand.channeled :refer [query! batching-deletes]])

(let [[results errors]
      (->> (query! creds :games
                   {:user-id [:= "moea"]
                    :game-title [:begins-with "Super"]}
                   {:filter [:< [:score] 100]
                    :limit  100})
           (async/split map?))
      {delete-chan :in-chan} (batching-deletes creds {:table :games})]
  (async/pipe results delete-chan))

Clojurescript

All of the functionality (barring the synchronous convenience functions) is exposed via Clojurescript. The implementation specifically targets Node, and uses lein-npm for declaring its dependency on bignumber.js. The wiki contains more information about number handling, which is the only substantial difference from the Clojure implementation.

The specific use-case I had in mind for Node support is writing AWS Lambda functions in Clojurescript.

See the Eulalie README for other Node-relevant details.

Development

Most of the integration tests expect an instance of DynamoDB Local. If the LOCAL_DYNAMO_URL environment variable isn't set, those tests will be skipped.

A couple of the tests expect to get capacity information back from Dynamo, and so can't run against a local instance. If AWS_ACCESS_KEY and AWS_SECRET_KEY are set, these tests'll try to connect and interact with a table (in Dynamo's default region, us-east-1).

Assuming a local Node install, lein cljsbuild once test-none will run the Clojurescript tests. test-advanced will run the tests under :optimizations :advanced.

Contributions welcomed.

See Also

  • Faraday - An excellent, synchronous Dynamo client built on the official AWS client library. Hildebrand's approach to type handling was largely copied from Faraday.

License

hildebrand is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.