(defn add-index
"Adds an index to an empty relation named name"
[db name key]
(assert (empty? (:data (db name))))
(let [rel (db name)
inx (assoc (:indexes rel) key {})]
(assoc db name (datalog-relation (:schema rel)
(:data rel)
inx))))
Comments top
No comments for add-index. Log in to add a comment.