CARVIEW |
Every repository with this icon (

Every repository with this icon (

Description: | A Clojure library for working with Amazon SimpleDB edit |
Homepage: | edit |
Public Clone URL: |
git://github.com/richhickey/sdb.git
Give this clone URL to anyone.
git clone git://github.com/richhickey/sdb.git
|
Your Clone URL: |
Use this clone URL yourself.
git clone git@github.com:richhickey/sdb.git
|
name | age | message | |
---|---|---|---|
![]() |
README.textile | Wed Jun 10 17:40:16 -0700 2009 | removed 'here' from readme [richhickey] |
![]() |
epl-v10.html | Tue May 12 09:30:37 -0700 2009 | prep for push to github [richhickey] |
![]() |
src/ | Mon May 18 14:03:11 -0700 2009 | Allow create-client to take a DB config as an o... [technomancy] |
sdb
A Clojure library for working with Amazon SimpleDB , (docs)
Built on top of Amazon’s Java API for SimpleDB , (javadocs)
The library lets you directly save and load Clojure data, and query using data. No strings! Stores using lexicographically-sortable representations. Can store strings, keywords, ints, longs, Dates, booleans and UUIDs, and can be extended to other primitives.
The dependencies can be downloaded from the downloads area
Usage
(use 'org.clojure.sdb) (def aws-key "[...]") (def aws-secret-key "[...]") (def client (create-client aws-key aws-secret-key)) (put-attrs client "heroes" {:sdb/id "spiderman" :power "spidery-things" :secret-identity "Peter Parker"}) (put-attrs client "heroes" {:sdb/id "hulk" :power "huge angry thing" :secret-identity "Bruce Banner"}) (put-attrs client "heroes" {:sdb/id "venom" :power "spidery-things" :secret-identity "Eddie Brock" :evil true}) (get-attrs client "heroes" "spiderman") ;; {:secret-identity "Peter Parker", :power "spidery-things", :sdb/id "spiderman"} (query client '{:select [:secret-identity] :from "heroes" :where (= :evil true)}) ;; ({:secret-identity "Eddie Brock", :sdb/id "venom"})
Local Use
It’s not always desirable to connect to a live server when using SimpleDB since you get charged (a small amount) for every transaction, and you won’t be able to develop while offline. To develop against a local SimpleDB mock, download and install SimpleDB-dev and configure your client to use an alternate service URL:
$ wget https://simpledb-dev.googlecode.com/files/simpledb-dev-0.1.10.zip $ unzip simpledb-dev-0.1.10.zip $ python SimpleDB-Dev/src/simpledb_dev.py & In your code: (create-client my-sdb-key my-sdb-secret-key (.withServiceURL (com.amazonaws.sdb.AmazonSimpleDBConfig.) "https://localhost:8080")))