seed-predicate-for-insertion

clojure.contrib.datalog.magic

  • (seed-predicate-for-insertion q)
Given a query, return the predicate to use for database insertion.

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/magic.clj:90 top

(defn seed-predicate-for-insertion
  "Given a query, return the predicate to use for database insertion."
  [q]
  (let [seed (-> q seed-rule :body first)
        columns (-> seed :term-bindings keys)
        new-term-bindings (-> q :term-bindings (select-keys columns))]
    (assoc seed :term-bindings new-term-bindings)))
Vars in clojure.contrib.datalog.magic/seed-predicate-for-insertion: assoc defn let
Used in 0 other vars

Comments top

No comments for seed-predicate-for-insertion. Log in to add a comment.