Fork me on GitHub

Hi gents! Can you please explain me why duct.database/sql doesn’t work when I configure connection in config.edn not dev.edn. I catch the following exception:

class duct.database.sql.Boundary cannot be cast to class clojure.lang.IFn
   (duct.database.sql.Boundary is in unnamed module of loader
   clojure.lang.DynamicClassLoader @1cc6aa6c; clojure.lang.IFn is in unnamed
   module of loader 'app')


so, if in example lein new duct my-app +api +ataraxy +example +postgres I will moved duct.database/sql section from dev.edn to config.edn I with catch this problem


@y.khmelevskii Hi. Can you tell me the version of duct yo’re using?


@jahson I used last versions:

duct/core           {:mvn/version "0.7.0"}
  duct/module.sql     {:mvn/version "0.5.0"}


Where do you place your duct.database/sql section in config.edn? It seems like you’ve placed it outside of the base profile?


I got the error, and the cause is the wrong placement of :duct.database/sql configuration. Basically it should be in :duct.profile/base section. The reason is that in the version 0.11 of duct framework the profiles were added, and now the first level of keys in config is for modules / profiles.


@jahson I got you, thank you!


and one more question. I use ragtime and I want to move description af all migrations to separate migration.edn. In previous version I could use :duct.core/include ["migration"] but now I should use {:duct.profile/migration #duct/include "migration"]}. But it doesn’t work for me No method in multimethod 'init-key' for dispatch value: :duct.profile/migration


I think you could just put something like :duct.migrator/ragtime {:migrations #duct/include "migrations"} or :duct.migrator/ragtime {:migrations [#duct/include "migration1" ...]}. What yo’re trying to do is to include the profile called migration, but your profile isn’t derived from :duct/profile. You should look for duct_hierarchy.edn in src directory and add the derivation, like in


thank you for explanation @jahson!