 (defn get-runs
   "Returns the list of runs for the given suite"
   [conn project-id suite-id]
-  (j/query conn [get-suite-runs-sql suite-id project-id]
-    :row-fn (comp #(assoc % :project-id project-id) format-dates)
-    :identifiers ident-fn
-    :result-set-fn vec))
+  (query conn [get-suite-runs-sql suite-id project-id]
+         :row-fn (comp #(assoc % :project-id project-id) format-dates)
+         :result-set-fn vec))
 
 ;; Suites
 (defn get-suite

                 safter.os after_os,
                 safter.screenshot_name after_name,
                 safter.path after_path FROM analysis
    JOIN diff ON diff.analysis_id = analysis.id
    JOIN diff_image ON diff.diff_image = diff_image.id
    JOIN screenshot safter ON safter.id = diff.after
    JOIN screenshot sbefore ON sbefore.id = diff.before
    WHERE analysis.run_id = ?" run-id]
                :row-fn format-dates
                :identifiers ident-fn
                :result-set-fn vec)]
    {:analysis analysis :diffs diffs}))


  (when-let [suite (get-suite-by-id conn project-id suite-id #(dissoc % :project-id))]
    (assoc suite :runs (get-runs conn project-id suite-id)
                 :project (get-project-by-id conn project-id))))

(def ^:private get-suites-sql "SELECT suite.id, suite.name FROM suite JOIN project ON project.id = suite.project_id WHERE project.id = ?")
(defn get-suites
  "Returns the list of suites"
  [conn project-id]
  (query conn [get-suites-sql project-id] :result-set-fn vec))

;; Projects
(defn get-projects
  "Retrieve the list of projects"
  [conn]
  (query conn ["SELECT * FROM project"] :result-set-fn vec))

(defn get-project
  "Returns the project with list of suites"
