Fork me on GitHub
#datomic
<
2018-06-13
>
Andreas Liljeqvist12:06:30

How do I handle a customer that might stop having an address? Like [:db/retract 123 :customer/address "oldaddress"]

Andreas Liljeqvist12:06:59

Is there some util-functions that will take an entity and produce the needed retractions?

Andreas Liljeqvist12:06:37

{:db/id 123 :customer/attribute :something} should in this case retract :customer/address

Andreas Liljeqvist13:06:24

Doing an SPA and having a hard time figuring out how to communicate changes back to the server

rhansen13:06:48

How do people do local development when using datomic cloud in production? If I understand the documentation correctly, there is a different client api dependency for on-prem and cloud, and the client api doesn't have an in-memory mode. Just wondering how I'm supposed to do unit testing or local development if on a plane or the network goes down.

stuarthalloway14:06:47

well, partially anyway

stuarthalloway14:06:13

{:server-type :ion
              :region "us-east-1"
              :system "stu-8"
              :query-group "stu-8"
              :endpoint ""
              :proxy-port 8182}

stuarthalloway14:06:38

that will resolve to the local implementation when deployed into an ion, but will go through the socks proxy for local dev

stuarthalloway14:06:17

so you do need a network connection, but there is a local dev story

stuarthalloway14:06:13

that all said, we understand the value of local dev and plan to continue improving in that area

marshall14:06:44

@alqvist That function will retract the entire entity. If you just want to retract a single attribute of the entity, you can do it exactly as you showed, issuing an explicit [:db/retract entityID :attrID Value] in a transaction

rhansen14:06:47

@stuarthalloway Interesting. My goal is an ion setup, so this does seem to help 🙂

Andreas Liljeqvist14:06:49

@marshall On the client I have a pull(nested map) for some entity. A few assocs and dissocs is applied to that map - How can use the original map and the new to get a list of transactions that will lead to the same state?

alexmiller14:06:55

I don’t think there is a thing for that but you could probably use something like http://clojure.github.io/clojure/clojure.data-api.html#clojure.data/diff to make data that you transform into a txn

alexmiller14:06:36

might be a nifty small library. maybe someone has already done this?

cjsauer16:06:55

@alexmiller @andreas862 I've had my eye on this library for use cases such as this: https://github.com/juji-io/editscript

Andreas Liljeqvist08:06:32

Thanks for the link, will check it out

johnj16:06:27

the readme in datomic-free.zip says one can get the peer from maven but no version of it shows in maven https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.datomic%22%20AND%20a%3A%22datomic-free%22

johnj16:06:26

is this a wrong readme?

marshall16:06:50

the Datomic Free peer is in clojars The Datomic Pro peer is available by private maven repo, credentials supplied in your http://my.datomic.com account @lockdown-

johnj16:06:09

@marshall ok, looks like it wasn't resolving for me because the latest version is not available in clojars yet: https://clojars.org/com.datomic/datomic-free

marshall16:06:24

@lockdown- Ah - i’ll have a look. Thanks for catching that

marshall16:06:33

@lockdown- if you need it in the interim, you can download it directly from https://my.datomic.com/downloads/free and use the bin/maven-install script to install it locally

johnj16:06:50

yeah thanks, that's what I did 👍

bj20:06:03

Is it possible to get a db value for a (basis-)t? Nevermind... (d/as-of db my-basis-t)

steveb8n23:06:31

@rhansen I created https://github.com/stevebuik/ns-clone to deal with this. works well for me. Sounds like it won’t be necessary in future though.