duct

fmjrey 2019-10-24T12:49:18.021300Z

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

fmjrey 2019-10-24T12:51:00.022300Z

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"}}
 

fmjrey 2019-10-24T13:00:26.023Z

alternatively: any tips on how to debug duct configs?

2019-10-24T13:00:42.023400Z

It might be because migrations should be in profile

2019-10-24T13:00:57.023900Z

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

fmjrey 2019-10-24T13:00:59.024Z

well they are in base profile

fmjrey 2019-10-24T13:01:09.024200Z

let me check

fmjrey 2019-10-24T13:02:16.024900Z

oh they're not.... good catch

2019-10-24T13:02:24.025100Z

https://github.com/jahson/blog-film-ratings/blob/master/resources/film_ratings/config.edn here's an example that should work

fmjrey 2019-10-24T13:04:10.026900Z

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

2019-10-24T13:05:15.027Z

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

👏 1
fmjrey 2019-10-24T19:07:47.027600Z

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

fmjrey 2019-10-24T19:12:52.028600Z

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

fmjrey 2019-10-24T19:44:56.030200Z

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.

👍 1