 
 ;; Join a set of predicates together with an 'and' relationship,
 ;; performing an intersection (via natural join).
-(defmethod compile-term "and"
+(defmethod compile-term :connective
   [[op & terms]]
   {:pre  [(every? vector? terms)]
    :post [(string? (:where %))]}

  "Recursively compile a query into a structured map reflecting the terms of
  the query."
  (fn [query]
    (string/lower-case (first query))))

(defn build-join-expr
  "Builds an inner join expression between catalog_resources and the given

        params (mapcat :params terms)
        query (->> (map :where terms)
                   (map #(format "(%s)" %))
                   (string/join (format " %s " (string/upper-case op))))]
    {:joins joins
     :where query
     :params params}))
