I've pushed out a significant update for adi, along with quite a long 
readme @ https://github.com/zcaudate/adi

Some highlights:

1. Required keys

(adi/insert! ds {:account {:credits 10}});; => (throws Exception "The following 
keys are required: #{:account/user :account/password}")


2. Schema checking

(adi/insert! ds {:account {:user "adi" :password "hello1" :type :vip}});;=> 
(throws Exception "(:type :vip) not in schema definition")

3. Restrictions

(adi/insert! ds {:account {:user "adi" :password "hello"}});;=> (throws 
Exception "The value hello does not meet the restriction: password needs an 
integer to be in the string")


4. Search constraints 

(adi/select ds {:account/credits '(> 10)} :first :hide-ids);;=> {:account 
{:user "adi3", :password "hello3", :credits 1000, :type :account.type/free}}


5. Data views

(adi/select ds {:account/user "adi1"} :first :hide-ids :view {:account/books 
:follow});;=> {:account {:user "adi1", :password "hello1", :credits 0,;;        
      :books #{{:author "Louis Cha", :name "The Book and the Sword"}}, :type 
:account.type/free}}
(adi/select ds {:account/user "adi1"} :first :hide-ids :view {:account/books 
:follow
                                                              :account/user 
:hide
                                                              :account/password 
:hide
                                                              :account/credits 
:hide
                                                              :account/type 
:hide});;=> {:account {:books #{{:author "Louis Cha", :name "The Book and the 
Sword"}}}}


-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to