   :content-types-provided (constantly {resource-list-c-t resource-list-as-json}))
 
 ;; ## SQL query compiler
+;;
+;; Compile an '=' predicate, the basic atom of a resource query. This
+;; will produce a query that selects a set of hashes matching the
+;; predicate, which can then be combined with connectives to build
+;; complex queries.
 (defmethod compile-query->sql "="
-  "Compile an '=' predicate, the basic atom of a resource query. This will
-produce a query that selects a set of hashes matching the predicate, which
-can then be combined with connectives to build complex queries."
   [db [op path value :as term]]
   (let [count (count term)]
     (if (not (= 3 count))

                   (format "(%s)"))]
    (apply vector query params)))

(defmethod compile-query->sql "or"
  "Join a set of predicates together with an 'or' relationship, performing a
union operation."
  [db [op & terms]]
  {:pre [(every? vector? terms)]
   :post [(string? (first %))

  (let [ids (range (count queries))]
    (map #(format "%s resources_%d" %1 %2) queries ids)))

;; Join a set of predicates together with an 'and' relationship,
;; performing an intersection (via natural join).
(defmethod compile-query->sql "and"
  [db [op & terms]]
  {:pre [(every? vector? terms)]
   :post [(string? (first %))
