Fork me on GitHub
#datomic
<
2018-06-26
>
folcon00:06:11

If we have suggestions for where the docs are puzzling is there a process for that?

folcon01:06:36

For eg:

datomic.ion.lambda.handler.exceptions.Incorrect: No implementation of method: :->bbuf of protocol: #'datomic.ion.lambda.dispatcher/ToBbuf found for class: clojure.lang.LazySeq
Documenting under troubleshooting that this means please return a string?

marshall13:06:50

@folcon https://docs.datomic.com/cloud/ions/ions-reference.html#signatures however I will also add that exception to the troubleshooting section

folcon13:06:24

@marshall Thanks, I only noticed that later, it was just really puzzling in the moment as I had no idea where the problem was. This wasn’t an issue I had surfaced when I was debugging it in my repl.

folcon13:06:56

Although equally it might be that I’m not clear on how I’m supposed to be developing lambda expressions in the repl. I’m still trying to understand how the instance roles permissions that stu was referring to translate into the difference of working in local development vs running in the cloud. IE: Do I test that I’m running in a dev and then check envvars vs doing something else when I detect I’m in a lambda? At the moment my workaround is just using envvars and setting them in the repl, and manually doing the same for the lambda env vars. That way I can maintain config values outside my code.

tomc15:06:29

If in my local/dev datomic system I add an attribute of type :db.type/string but meant to use :db.type/ref, and I haven't used that attribute anywhere else yet is the only way to fix the attribute to restore to an earlier backup?

marshall15:06:30

@tomc you could rename the erroneous one and create a new attribute of the correct type with that name instead

tomc16:06:55

@marshallThanks, that solved my problem.

len16:06:17

We have a job system that uses datomic and we want to add callbacks for when the job completes or fails - how would I save those functions to an entity in datomic ?

len16:06:53

I guess I could have a multimethod and then save a keyword to dispatch on in datomic

Spencer Apple17:06:33

Hello, is it required to update the schema when you want to expand your enum? It works locally for development, but am not sure what will happen on prod. E.G. I have my attribute :person/eye-color with the possible values: {:db/ident :person.eye-color/blue} and {:db/ident :person.eye-color/brown}. If I want to add {:db/ident :person.eye-color/red}, do I need to update the schema?

marshall17:06:18

you would need to transact the new enum value

marshall17:06:22

which is just adding a new entity

marshall17:06:56

Datomic doesn’t restrict the “types” or “targets” of reference attributes

marshall17:06:17

so your :person/eye-color reference attribute could be a ref to any other entity

marshall17:06:42

by convention (and application enforcement), you constrain it to the eye color entities you’ve created

marshall17:06:09

@splayemu ^ does that answer your question?

Spencer Apple17:06:38

ah @marshall so the enum entities live in the user partition then? So if your application code transacts a new entity:

{:db/id ....
 :person/eye-color {:db/ident :person.eye-color/red}}
Everything will work fine because datomic will also create the new entity for {:db/ident :person.eye-color/red}. Then I assume the next time you would create a new {:db/ident :person.eye-color/red}, instead it references the other one?

currentoor18:06:20

Hi, I used on-prem datomic in the past and now for a new project I really want to use datomic cloud but I need to keep several UIs on separate devices in sync, so I need something like txReportQueue. I know datomic cloud doesn't have that but is there a way to build it myself? Any suggestions?

alexk19:06:52

I wrote a datomic->mongo streamer that worked by keeping track of the basis-t last synced. Every time it polled datomic & found it was behind, it would use the tx log to get a list of changed entities, filter down to just the top-level ones, then convert those to mongo format and send them to mongo.

currentoor19:06:50

how often did you poll?

alexk19:06:10

every 10 seconds

currentoor19:06:13

i need something real time

currentoor19:06:01

in my case though, i'd also need to have a persistent connection between the datomic could instances and my application server

currentoor19:06:39

or constant pings for novelty, which might not be possible given the lambda architecture

currentoor19:06:32

i'm thinking i could have something in the datomic cloud instance that notices novelty and pushes to a queue outside datomic, which my app server can subscribe to

alexk19:06:14

that sounds ok, it would be pretty lightweight. I don’t know of any decent way to get push-style changes from datomic but I wish there was

currentoor19:06:39

yeah i might just have to stick to on-prem because of this 🙁

currentoor20:06:27

txReportQueue was a godsend

currentoor20:06:00

yeah 🙁 indeed, txReportQueue was such a beautiful feat of engineering

currentoor20:06:57

Are there any plans or desires to add something like txReportQueue to datomic cloud?