I'm trying to use Joplin for database migration in the project javaee-utility-belt (despite the name, it's written in Clojure ;-) The way I found to start programming in Clojure at work:
#<CompilerException java.lang.IllegalArgumentException: No method in multimethod 'migrate-db' for dispatch value: :sql, compiling:(jub/core.clj:5:16)>
I've added joplin.core in my dependencies:
:dependencies [[org.clojure/clojure "1.6.0" ]
[org.clojure/java.jdbc "0.3.6" ]
[mysql/mysql-connector-java "5.1.25"]
[joplin.core "0.2.9" ]]
I'm trying to call Joplin from code to run the migration automatically at every execution. For that, I wrote datasource.clj as follows:
(ns jub.datasource
(:require [clojure.java.jdbc :as jdbc]
[joplin.core :as joplin]))
(def mysql-db {:subprotocol "mysql"
:subname "//localhost:3306/jub"
:user "jub_user"
:password "psswd"})
(def joplin-target {:db {:type :sql, :url (str "jdbc:mysql:" (get mysql-db :subname)
"?user=" (get mysql-db :user)
"&password=" (get mysql-db :password))}
:migrator "resources/migrators/sql"})
(defn migrate-mysql-db []
(joplin/migrate-db joplin-target))
Then, I'm calling migrate-mysql-db from core.clj, as follows:
(ns jub.core
(:require [jub.log-file :refer :all]
[jub.datasource :refer (migrate-mysql-db)])
(:gen-class))
(migrate-mysql-db)
When I start the repl (lein repl) the function (migrate-mysql-db) is called and the exception above is produced.
Can anybody help me with this issue? Thanks in advance!