Fork me on GitHub

I'm trying to shift my thinking from an app shared atom

(:db @app)
to using the
key. The smallest step to refactor my app to at least "compile" is to switch out a function
that used to return the db spec
(:db @app)
. How can I evaluate the ig/ref for key :duct.module/sql to get back the db spec? so far I have
(ns watchdude.state
  (:require [duct.database.sql :as sql]
            [integrant.core :as ig]
            [taoensso.timbre :as log])
  (:import (duct.database.sql Boundary)))

(defmethod ig/init-key ::app-db [_ {:keys [db]}]
  (log/info db)

;; (defn app-db [] (:db @app)
(defn app-db "get db spec out of duct.database.sql"
with config.edn
:duct.module/sql {:database-url "localhost"}
 :watchdude.state/app-db {}