yogthos / migratus

MIGRATE ALL THE THINGS!
642 stars 93 forks source link

Cannot pass DataSource or Connection through :db #181

Closed mjhanninen closed 2 years ago

mjhanninen commented 4 years ago

The PR #174 changed the connect* call from

(connect* (:db config))

to

(connect* (assoc (:db config) :transaction? (:init-in-transaction? config)))

on line database.clj:248.

This breaks any existing code that passes java.sql.Connection or javax.sql.DataSource through the :db field as instructed in Alternative setup and upgrades from the version 1.2.4.

Luckily this issue can be side-stepped by using either:

(def config {:db {:datasource <datasource>}})

or

(def config {:db {:connection <connection>}})

I think that the documentation or code (or both) needs to be adjusted.