datomock
datomock copied to clipboard
Client API support?
Quickly skimmed through the client API and it has with-db
. Now that cloud is a thing it would be amazing to quickly fork prod DB's. Anything holding this back?
https://docs.datomic.com/client-api/datomic.client.api.html#var-with-db
@den1k db.with()
support on clients is potentially somewhat unreliable for this use - I'm waiting for Stuart Halloway to come back to me with more info.
In any case, if we're to create with-backed mock connections on Clients, it's probably more sensible to do it in another library.
Just another :+1: form me
and one from me too, especially now that dev-local exists.
Joshua Heimbach was also asking about this capability on slack so interest is building
Alright folks, I probably won't have time to make that dev anytime soon, especially given that I don't use the client lib currently.
Having said that: as I mentioned above, I think it's sensible to do that in a separate lib, to keep dependencies separate. So feel free to make that lib - I suggest datomock-client
for the name. I really don't expect it to be hard, an undocumented implementation should be below 200 LoC. I could imagine this as a Kata in a Clojure meetup.
Compared to this lib, the main additional difficulties I see are:
-
Making the API async will make things slightly harder than in this lib, you'll probably want to keep the state in a core.async loop rather than an Atom or Agent (a nice core.async exercise!).
-
The Client API offers no protocol or interface for Connections. There probably is one, but as an implementation detail that will have to be discovered and relied on.