• (add-index db name key)
Adds an index to an empty relation named name

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/datalog/database.clj:86 top

(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))))
Vars in clojure.contrib.datalog.database/add-index: assert assoc defn empty? let name
Used in 0 other vars

Comments top

No comments for add-index. Log in to add a comment.