Fork me on GitHub

@fenton: Your queries are evaluated in your application process, not in the transactor. Thus, whatever logging you use in your client application can be used to log functions called from within Datalog queries. The same does not hold for functions evaluated by the transactor. The easiest way to debug transactor functions is to use an in-memory database to make them be evaluated in your application process as well.


If I have a separate datomic server, the transcript is out of my process


OK in Mendy is how I should change the deployment then I guess. Thank you for the advice!!


Hmmm I guess I'm unclear which are transactor functions... I have a function call in my datomic query datalog...


Your queries are never sent to the transactor.


Is the datomic:free:// protocol still relevant? Is it the same as :dev?


:free means limited to 3 peers at the transactor (so two other peers), and using the local h2 in-transactor storage


:dev means limited to your paid license peer limit, and using the local h2 in-transactor storage


you can use :free with a pro transactor.


I'm using to Pro Starter license


With Pro Starter you can use the datomic:dev://... protocol for local storage on the filesystem where the transactor is running. This is effectively the same as the datomic:free://... protocol.


@fenton: You can use stored database functions ( in query OR as transaction functions (assuming they return the proper type of data for the latter). If they’re executed in a datalog query, as @hans says, they’ll be run entirely in your peer (your application process). If you call them in a transaction (i.e. inside a call to d/transact - they will be executed on the transactor.


How would you tag some entities in order to toggle them in and out of query results, having multiple tags where only one can be active at any moment?


I have normal data, and extra data that is part of a simulated data generation. I'd like to run several simulations, saving them, and later choose which one to active. If none is activated, I ignore the tagged entities.


Either a :simulation/active attribute for each of those simulations, where I have to remove and add this attribute manually, or some kind of singleton entity for the currently active simulation. But I don't know how to implement this singleton entity.


can't you just tag them all with a string, and query for a certain string?


How do I know which string?


Is your set of tags fairly small and fixed?


fairly small but dynamic. not fixed. Every time someone runs a simulation, I'd like to represent it as an entity, with time of execution etc.


and that entity is the tag?


yes, and only one of them can be active, or none at all.


you could use a cardinality one reference attribute to the 'tag entity'


you can retract to set ‘none'


that cardinality one ref attribute, which entity does it itself belong to?


the data entities you’re tagging


But if I retract the tag from data entities, they will become normal data. They must always remember to which tag they belong, so I can activate/deactivate any set of simulation data.


perhaps an entity with {:db/ident :active-simulation :db/valueType :db.type/ref :db/cardinality :db.cardinality/one}


if you need to maintain both ‘on/off’ and a specific tag, then yes, you’ll need two separate attributes.


maybe {:db/id #db/id[:db.part/user] :db/ident :active-tag :active-tag/current 123} That way I can always refer to the single entity with :active-tag ident.


@marshall: thank you marshall, i understand better now what a transactor function is. I was confused about query function and datalog in general. it seemed like it was all shipped off somewhere as functions had to be fully qualified, but i now just assume that they are run from a different namespace ( the datomic namespace ), but same process. I had cider-debug instrumented the functions, but they weren't getting breakpointed in, so I assumed, incorrectly, they were shipped off to the datomic process. Now I've got the correct mental model, I'll pursue finding out where/why the logs didn't seem to work. Thanks!!