Fork me on GitHub
#datomic
<
2018-09-28
>
ninja08:09:14

Hi, is it possible to add multiple JARs to the transactor classpath? The documentation only covers the case where a single jar is added. There has to be some kind of separator...

ninja11:09:51

Just found a solution. For the record: One needs to copy the JARs that should go on the transactor's classpath into the /lib directory of the transactor. There are already several other jars present like ant and so on. Nothing else needed to be done (at least for datomic free). This is something I was not able to find in the docs. Maybe some lines about this topic should be added.

Andreas Liljeqvist09:09:49

Sometimes I want to use multimethods on a pulled entity. Problem is that I have no explicit type to dispatch on. Any words of wisdom regarding this? One solution is to add :db/entity-type or something to all my schemas

pvillegas1213:09:14

You can also dispatch on the presence of specific combination of attributes

Andreas Liljeqvist16:09:20

I fail to see how, without leaking knowledge to the dispatch fn?

steveb8n16:09:28

I have an :all/type attr on all entities

joelsanchez10:09:42

well. I use an :schema/type attribute and all my entities have a type

­čĹŹ 4
joelsanchez10:09:40

I think it's pretty common practice with datomic, to have an attribute for that

dazld10:09:37

if you have a shared attribute, does that cause any issues with indexes?

dazld10:09:54

say, :sys/created-at or something too

octahedrion13:09:31

when Datomic says "tempid used only as value in transaction" is there any way to get the specific assertion that caused it ?

joelsanchez16:09:27

that's one of the most cryptic error messages in Datomic imo. it can mean using a tempid of an entity that's not in the transaction, or trying to use a string where a ref should've been

joelsanchez16:09:49

in particular, the second case isn't obvious at all

misha19:09:04

ladies and gentlemen, 1) do you add your custom attributes to datomic schema to specify the domain-type of a ref-type attributes value(s)? For example, :foo/bars is a :type/ref :cardinality/many attribute, and it supposed to contain :bar entities. But vanilla db-schema does not specify the type of the objs it points to. 2) how often do you have same :type/ref attributes pointing to the objs of different domain type? E.g. :foo/bars pointing to 2 :bar objs and 1 :baz obj.

joelsanchez19:09:31

1) yes I specify the type of a ref, but I don't validate it 2) almost always, a ref attr has values that refer to entities of the same type

misha19:09:25

how your (1) helps then? isn't some "name convention" enough then?

joelsanchez19:09:07

it helps with ES indexing, but not much else

misha19:09:40

3) how do you give a name to a domain obj, if there is no reified "entity" notion in datomic, because any id can "contain" any attributes out of schema

misha19:09:00

to lookup clojure-to-ES mappings?

joelsanchez19:09:02

I have a :schema/type attribute. every entity has this attribute. an example value is :schema.type/user. when I create a ref attribute, I usually set a :schema/refEntityType, for example :schema.type/user.

joelsanchez19:09:13

in the case of ES, it helps me to identify special cases, like i18n entities

joelsanchez19:09:26

I'm just saying, it's not a bad idea, it can be helpful, but it's not that needed

joelsanchez19:09:18

for example, in ES I can't just save :product/name as a product/name field in ES. I need to generate one for every lang, such as product/name__en_US for indexing purposes

joelsanchez19:09:38

when I encounter a ref with a refEntityType of :schema.type/i18n, I do that

joelsanchez19:09:51

> any id can "contain" any attributes out of schema this is helpful, but it's also helpful to know the type of the entities, and to know what type should a ref point to ­čÖé

joelsanchez19:09:25

there are attrs that are specific to an entity, like :user/name, but also global ones

misha19:09:40

sweet, thank you for reply