Closed cap10morgan closed 9 years ago
This is welcome work!
@tie-rack & @ericnormand I dropped the unnecessary default-connection
atom for now so we would at least have a coherent PR to comment on. But please feel free to keep asking questions about it.
I look forward to using the library with this patch.
The code looks really good. The functionality is more than welcome.
LGTM
This PR is something I made while getting frustrated by my inability to easily use some of datomic-toolbox's features from a REPL that was connected to a different Datomic transactor than was configured in config.edn and my slight annoyance at having to update this library in order to use the latest resource-config version in an app that depended on both of them.
It is intended to start a conversation about how we would like datomic-toolbox and resource-config to interact. As such it goes all the way to the extreme of removing the resource-config dependency entirely, putting all state into atoms, and providing stateless alternatives to all fns that weren't either a) already stateless or b) provided in datomic.api already.
It should be compatible with existing datomic-toolbox consumers with one exception: You must now pass in your Datomic config (which are more than welcome to get from resource-config) into the
datomic-toolbox.core/initialize
function. If you aren't usinginitialize
(and really, why wouldn't you? it's idempotent), then you can call the newdatomic-toolbox.core/configure!
fn first instead. Either of these setup the internal Datomic config state so that the stateful fns work the way you're used to.All the tests still pass.