:watchdude.state/app-db {:db #ig/ref :duct.database/sql}
But in Duct you don't really need a :app-db
key. Instead you should provide the reference to the db
to component that uses the db.
That's very helpful and works. I do plan on removing the (now odd) :app-db just needed to understand this part first I guess.
Trying to get the integrant ideas straight in my mental model: so from the integrant readme
{:adapter/jetty {:port 8080, :handler #ig/ref :handler/greet}
:handler/greet {:name "Alice"}}
is to {:my-namespace/my-fn-var {:my-key-in-param #ig/ref :an-integrant-key-ref}
The main idea is simple, IMO: the app will be started and the config will be transformed into the running system. Each key will be init
ed and replaced by the result of the appropriate ig/init-key
. The keys will be init
ed in such order that each component will get its dependencies init
ed.
The duct guide is the most up to date doc AFAIK https://github.com/duct-framework/docs/blob/master/GUIDE.rst
There is also articles like https://circleci.com/blog/build-a-clojure-web-app-using-duct/
But the last time I've read this article it was a bit outdated — it was using duct before 0.11
, and there were breaking changes. https://github.com/duct-framework/docs/blob/master/DESIGN-0.11.rst