Fork me on GitHub
#datomic
<
2016-07-26
>
hans04:07:51

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

fenton04:07:10

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

fenton04:07:50

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

fenton04:07:30

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

hans05:07:14

Your queries are never sent to the transactor.

yonatanel07:07:05

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

robert-stuttaford10:07:08

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

robert-stuttaford10:07:37

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

robert-stuttaford10:07:07

you can use :free with a pro transactor.

yonatanel11:07:40

I'm using to Pro Starter license

Lambda/Sierra13:07:48

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.

marshall13:07:00

@fenton: You can use stored database functions (http://docs.datomic.com/database-functions.html) 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 - http://docs.datomic.com/transactions.html#built-in-transaction-functions) they will be executed on the transactor.

yonatanel13:07:34

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?

yonatanel13:07:28

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.

yonatanel13:07:07

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.

danielstockton13:07:52

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

yonatanel13:07:06

How do I know which string?

marshall13:07:41

Is your set of tags fairly small and fixed?

yonatanel13:07:32

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.

marshall13:07:57

and that entity is the tag?

yonatanel13:07:21

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

marshall13:07:55

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

marshall13:07:36

you can retract to set ‘none'

yonatanel13:07:11

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

marshall13:07:42

the data entities you’re tagging

yonatanel13:07:56

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.

yonatanel13:07:31

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

marshall13:07:44

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

yonatanel13:07:58

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.

fenton18:07:15

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