Hi. A duct noob question: in duct configuration, is there a way of having a "base" value for a key that's merged with a new value in each profile? So, for (absurd) example, if my base profile looks like this:
{:duct.profile/base
{:duct.core/project-ns foo
:foo/database {:db "mydb" :username "myuser"}}
:duct.profile/dev
#duct/include "dev"}
I want to be able to specify that the value for :foo/database
is merged with any value with the same key in each profile config. So, if my dev.edn
looked like this:
{:foo/database {:db "anotherdb"}}
the final value for :foo/database
would be (when the dev
profile is active):
{:foo/database {:db "anotherdb" :username "myuser"}}
Currently, this config would causes the base profile value for :foo/database
to be completed replaced with the value from the dev profile though.
Any thoughts? Or am I just approaching this problem from the wrong angle?(Historically I've achieved this sort of thing with aero using the #merge
and #ref
tag literals.)
One approach that should work (I think) is to extract the base config into a separate file which is then #included in each profile.