Fork me on GitHub

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


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?


@folcon however I will also add that exception to the troubleshooting section


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


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.


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?


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


@marshallThanks, that solved my problem.


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 ?


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?


you would need to transact the new enum value


which is just adding a new entity


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


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


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


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


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?


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.


how often did you poll?


every 10 seconds


i need something real time


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


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


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


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


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


txReportQueue was a godsend


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


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