datomock icon indicating copy to clipboard operation
datomock copied to clipboard

Client API support?

Open den1k opened this issue 7 years ago • 4 comments

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 avatar Jan 25 '18 15:01 den1k

@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.

vvvvalvalval avatar Jan 25 '18 17:01 vvvvalvalval

Just another :+1: form me

iku000888 avatar Oct 10 '19 21:10 iku000888

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

stevebuik avatar Nov 28 '20 00:11 stevebuik

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:

  1. 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!).

  2. 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.

vvvvalvalval avatar Dec 01 '20 00:12 vvvvalvalval