Fork me on GitHub
#datomic
<
2020-10-20
>
daniel.spaniel17:10:33

does datomic mem-db support tuple type ? i tried to add a tuple field and it barfed so not sure ?

favila17:10:06

This should be dependent on datomic lib version, not storage type

daniel.spaniel18:10:42

lib version? where is that found ? we use cloud db for production

favila18:10:45

how do you create a mem db with cloud?

daniel.spaniel18:10:14

you dont .. you use one or the other. looks like dev-local has some thing dev-local-tu for doing test like things where you blow away the db around each test, which is what we want. but i think mem-db does not support tuple

favila18:10:36

AFAIK before dev-local there were no mem-dbs with cloud

favila18:10:43

so I’m not sure what you are doing

favila18:10:13

if you use a peer-server with on-prem you could do it, but that depends on the peer lib’s version. There was also this: https://github.com/ComputeSoftware/datomic-client-memdb

daniel.spaniel18:10:34

that the one we using, but we just run that locally , when on prod using cloud db , we switch between one and the other

favila18:10:18

so, that depends on an on-prem lib, and that on-prem lib’s version is what’s dictating whether tuples are supported or not (most likely)

favila18:10:54

I’m just saying there’s more to the story than “mem-db -> no tuple types”

kenny19:10:41

I imported a prod db via dev-local/import-cloud. Is there a way to get a breakdown of the size of the db.log file?

kenny19:10:08

I'm also curious if import-cloud provides a way to import the current version of the database with no historical retracts.

kenny19:10:47

Are there any issues with running multiple import-cloud in parallel?

donyorm21:10:54

So I have an entity with a child with cardinality many, and I query for all entities where one of these child entities matches a value. I tried

'(or
  (and
    [?e :child-element-key ?ste]
    [(.contains ^java.lang.String ?ste "value")]))
But that didn't work, is there another way to do this?

favila21:10:58

clojure.core/list isn’t needed--you are already quoting

donyorm21:10:28

Thanks, sorry I copied and modified this from my code where I wasn't quoting

favila21:10:27

this is generally how you do it; it’s going to be difficult to diagnose your problem without a complete example. You could try simplifying the query with specific data to see what’s going wrong. e.g.:

(d/q '[:find ?e
       :where
       (or
         (and
          [?e :child-element-key ?ste]
          [(.contains ^java.lang.String ?ste "value")]))]
     [[1 :child-element-key "value1"]
      [2 :child-element-key "nope"]])
=> #{[1]}

donyorm21:10:29

Ok thanks, I wasn't sure if I was completely off base, probably an issue in my data then. Thank you!

donyorm21:10:34

Yes definitely was a problem in the data, thanks for the help though!