Fork me on GitHub
#mount
<
2016-06-03
>
fabrao02:06:24

Hello all, I´m trying to use mount with yesql but I didn´t figure out how to reference the dynamic functions defined in defqueries, when I compile by uberjar is getting "java.lang.RuntimeException: Unable to resolve symbol: buscar-device-id in this context, compiling:(*/session.clj:17:18)" I start it by

(defn iniciar [config]
  (log/debug "Ativando queries para acesso ao banco de dados")
  (sql/defqueries "sql/operacoes.sql" {:connection (:database config)}))

(defstate db
  :start (iniciar config))
how to use in other "component" the inside .sql function?

tolitius03:06:29

I doubt Unable to resolve symbol: buscar-device-id error is due to either mount or yesql.. looks like misconfiguration. having said that I am not a big fan of defqueries since it just magically binds vars that you can really reload cleanly (i.e. when restarting states / components) I would recommend two things: * don't use yesql, use something better: like hugsql: https://github.com/layerware/hugsql * steal make-queries from my yesql pull request and use that instead of defqueries: https://github.com/krisajenkins/yesql/pull/117 (`make-queries` just returns you a map of named queries without binding these names to anything)

fabrao04:06:30

but Hugsql has Oracle database connection?

tolitius13:06:19

> HugSQL defaults to using the clojure.java.jdbc library to run underlying database commands which is just JDBC, so your Oracle JDBC driver would work