Fork me on GitHub

@onetom Cool, nice find 🙂


Does the dynamic mean you can change the sql while the app is running? I found that I need to restart the whole app when I make a type.


shidima_: You should be able to just reload the sql fns with something like this

(def db (atom nil))

(defmacro init-queries-connect!
  [pool-spec resource-path]
  `(do (reset! db (conman/connect! ~pool-spec))
       (conman/bind-connection @db ~resource-path)))

(defn disconnect!
  (conman/disconnect! db)
  (reset! db nil))
assuming you have access to the conman


pool-spec is something like {:jdbc-url (:database-url conf)} or {:jdbc-url "jdbc:} and resource-path is "sql/queries.sql" and your sql file is located in {project root}/resources/sql/. If you have any question about the above just ask away 🙂


Tnx, I will look into it. I'm quite prone to typos and having to restart the whole app is a bit annoying 🙂


yeah I hate that too


also check out for adding deps to a running repl


for reseting state in a namespace


@U0S3YK6HK these are just the low level puzzle pieces you mentioned. tolitius/mount and stuartsierra/component and his reloaded workflow is meant to unify and codify these into a consistent and more flexible convention or framework. Using dynamic vars is one of the patterns which was alleviated by using mount or component, that's why it was surprising to see them combined. But @U050CBXUZ on #luminus gave an explanation why it might make sense still (which I'm still suspicious of but can't argue with because I don't know conman)


Is there a way to "add source root" when working with a cljs project so we can get keyword highlighting?


nvm, the issue is that we are using boot, not lein ... sorry