Adds a collection of tuples to the db, as
(add-tuples db
[:rel-name :key-1 1 :key-2 2]
[:rel-name :key-1 2 :key-2 3])
(defn add-tuples
"Adds a collection of tuples to the db, as
(add-tuples db
[:rel-name :key-1 1 :key-2 2]
[:rel-name :key-1 2 :key-2 3])"
[db & tupls]
(reduce #(add-tuple %1 (first %2) (apply hash-map (next %2))) db tupls))
Comments top
No comments for add-tuples. Log in to add a comment.