This is a question about datahike connections. In a Clojure web app with datahike, Claude elected to use the following pattern for most business logic -- I'm wondering if there is good rationale for this:
(defn cool-fn [x]
(let
[conn (get-connection)
...]
(d/transact conn {:tx-data [{:any "Data"}])
(d/release conn)
...))Indirection is usually used for good reason in Clojure — just not sure if Claude knows that in this case : )
You don't have to release the connection really unless you delete the database. I would pass the connection to functions explicitly, but if you just have one global connection then maybe it is fine.