yogthos / migratus

MIGRATE ALL THE THINGS!
640 stars 95 forks source link

No method in multimethod 'make-store' for dispatch value: null when passing a hikari connection pool #219

Closed jcpsantiago closed 1 year ago

jcpsantiago commented 1 year ago

Following the README I've modified my call to migrate to read:

(def connection-pool (hikari/make-datasource {:jdbc-url (env :jdbc-database-url)}))

(defn -main
  [& _]
  (migrate {:db connection-pool)}) 
  (start-task-scheduler)
  (start-scheduled-tasks)
  (web/start-server))

I can't start my application, get the error No method in multimethod 'make-store' for dispatch value: null. The pool is working well, because commenting out the migrate line let's me use the app as normal, including fetching and inserting data into the db using next.jdbc and HugSQL. (the actual code is not like this, uses an atom to keep the state of the pool).

migrate works if I pass a map as usual. Is this not intended usage? Looks the same as in the README

ieugen commented 1 year ago

Hi, @jcpsantiago ,

We currently have a bug related to this. We missed it in our release because the tests do not cover it. I was planning to have it fixed by now - but it did not happen. I hope to get around fixing it next week.

PR is welcomed if you find time for it.

ieugen commented 1 year ago

@jcpsantiago : We have fixed this as part of 1.4.0 release with updated README and next.jdbc version. You should use syntax : {:datasource ds} (see postgres tests and readme). Thanks for using migratus.