Skip to content

Commit

Permalink
Rename types constructor functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
niwinz committed May 26, 2016
1 parent 34babeb commit d599e22
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/suricatta/types.clj
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,9 @@
org.jooq.Configuration
org.jooq.ConnectionProvider
org.jooq.SQLDialect
java.sql.Connection
clojure.lang.Agent))
java.sql.Connection))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Context
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(deftype Context [^Configuration conf ^Agent act]
(deftype Context [^Configuration conf]
proto/IContextHolder
(-get-context [_] (DSL/using conf))
(-get-config [_] conf)
Expand All @@ -48,12 +43,10 @@
(.close connection)
(.set conf (org.jooq.impl.NoConnectionProvider.)))))

(defn ->context
(defn context
"Context instance constructor."
([^Configuration conf]
(Context. conf (agent 0)))
([^Configuration conf act]
(Context. conf act)))
[^Configuration conf]
(Context. conf))

(defn context?
[ctx]
Expand Down Expand Up @@ -89,6 +82,6 @@
(-get-context [_] (DSL/using conf))
(-get-config [_] conf))

(defn ->query
(defn query
[query conf]
(Query. query conf))

0 comments on commit d599e22

Please sign in to comment.