duct-framework / duct

Server-side application framework for Clojure
MIT License
1.13k stars 51 forks source link

Duct with MySQL #76

Closed xafizoff closed 6 years ago

xafizoff commented 6 years ago

I want to use MySQL with Duct. I've added mysql-connector-java library to the project.clj:

[mysql/mysql-connector-java "8.0.11" :exclusions [com.google.protobuf/protobuf-java]]

Note that I had to exclude protobuf, since piggieback requires a newer version of the protobuf. Then I added the :database-url key to the dev.clj:

:duct.module/sql
 {:database-url "jdbc:mysql://localhost:3306/mydb"}

But when I call (go) in the REPL, I get the following error:

ClassNotFoundException com.mysql.cj.log.duct.logger.timbre.TimbreLogger@4566f492  java.net.URLClassLoader.findClass (URLClassLoader.java:381)

How to get it working?

PS. I do not know if this is either a problem with the sql module, or a problem with logging module, so I reported this here.

xafizoff commented 6 years ago

Fixed by this commit, had to add explicit dependency on [duct/database.sql.hikaricp "0.3.3"]. Would be nice to have recent versions of the all libs with lein new duct ....