From 2506440c6fe68cca0d3ea682774f1bf769b1c623 Mon Sep 17 00:00:00 2001 From: gered Date: Sat, 21 May 2016 16:29:25 -0400 Subject: [PATCH] switch to using put-hints! --- src/views/honeysql/core.clj | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/views/honeysql/core.clj b/src/views/honeysql/core.clj index 5aca9c5..f3b715b 100644 --- a/src/views/honeysql/core.clj +++ b/src/views/honeysql/core.clj @@ -1,6 +1,6 @@ (ns views.honeysql.core (:require - [views.core :refer [view-system hint refresh-views!]] + [views.core :refer [view-system hint put-hints!]] [views.honeysql.util :refer [query-tables]] [honeysql.core :as hsql] [clojure.tools.logging :refer [error]] @@ -8,10 +8,6 @@ (def hint-type :sql-table-name) -(defn send-hints! - [hints] - ((:put-hints-fn @view-system) hints)) - (defmacro with-view-transaction "Like jdbc's with-db-transaction, but sends view hints at end of transaction." [binding & forms] @@ -22,7 +18,7 @@ result# (j/with-db-transaction [t# ~db ~@args] (let [~tvar (assoc ~db :hints hints#)] ~@forms))] - (send-hints! @hints#) + (put-hints! @hints#) result#)))) (defn- execute-honeysql! @@ -46,7 +42,7 @@ hsql-hint (hint namespace (query-tables action-map) hint-type)] (if-let [hints (:hints db)] (swap! hints conj hsql-hint) - (send-hints! [hsql-hint])) + (put-hints! [hsql-hint])) results)) ([db action-map] (vexec! db nil action-map)))