Fork me on GitHub
#duct
<
2019-10-24
>
fmjrey12:10:18

Hi, new to duct, any idea why I get db-spec null is missing a required parameter when adding the following at the end of config.edn of a fresh lein new duct simple-api +api +ataraxy +example +sqlite?

:duct.migrator/ragtime
 {:migrations [#ig/ref :simple-api.migration/example]}

 [:duct.migrator.ragtime/sql :simple-api.migration/example]
  {:up ["CREATE TABLE example (id int)"]
   :down ["DROP TABLE example"]}
I did the lein duct setup

fmjrey12:10:00

This was at the REPL, and the template did generate a dev.edn like so:

{:duct.database/sql
 {:connection-uri "jdbc:sqlite:db/dev.sqlite"}}
 

fmjrey13:10:26

alternatively: any tips on how to debug duct configs?

jahson20:10:55

Most of the time I've used the dev namespace. The system and the config are accessible in it. https://github.com/jahson/blog-film-ratings/blob/master/dev/src/dev.clj#L12

jahson13:10:42

It might be because migrations should be in profile

jahson13:10:57

The first level of config is for profiles and module configs.

fmjrey13:10:59

well they are in base profile

fmjrey13:10:09

let me check

fmjrey13:10:16

oh they're not.... good catch

fmjrey13:10:10

great, was looking for a recent example, thanks @jahson

jahson13:10:15

I'v ported the original code to new version of duct.

👏 4
fmjrey19:10:47

Hitting another hurdle with duct.database.sql.Boundary cannot be cast to clojure.lang.IFn...

fmjrey19:10:52

Even after removing all my custom handlers and only using the duct handler.sql lib

fmjrey19:10:56

Ahhh... solved by moving the :duct.database/sql into the profile. Really, anything not beginning with :duct.module or :duct.profile must be in a profile.

👍 4
jahson20:10:46

Almost right. You can put anything here as long, as it inherits from :duct/module (https://github.com/duct-framework/module.sql/blob/master/src/duct_hierarchy.edn) or :duct/profile (https://github.com/duct-framework/core/blob/master/src/duct_hierarchy.edn). The doc about profiles is not great at the moment, but there's bits of information scattered around. Like in issues https://github.com/duct-framework/core/issues/19#issuecomment-520406836 Or, in the actual source https://github.com/duct-framework/core/blob/52babf6f0df4846d7e3bf3bc8b16ee47a6898b4c/src/duct/core.clj#L183

👌 4
jahson20:10:55

Most of the time I've used the dev namespace. The system and the config are accessible in it. https://github.com/jahson/blog-film-ratings/blob/master/dev/src/dev.clj#L12