Fork me on GitHub
#duct
<
2019-09-10
>
jahson09:09:50

:watchdude.state/app-db {:db #ig/ref :duct.database/sql}

jahson09:09:14

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.

bocaj17:09:25

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.

bocaj17:09:51

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}

jahson20:09:24

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 inited and replaced by the result of the appropriate ig/init-key. The keys will be inited in such order that each component will get its dependencies inited.

jahson20:09:30

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