datomic

Ask questions on the official Q&A site at https://ask.datomic.com!
daniel.spaniel 2020-10-20T17:15:33.079Z

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

favila 2020-10-20T17:54:06.079200Z

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

daniel.spaniel 2020-10-20T18:06:42.079400Z

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

favila 2020-10-20T18:12:45.079600Z

how do you create a mem db with cloud?

daniel.spaniel 2020-10-20T18:43:14.079800Z

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

favila 2020-10-20T18:44:36.080Z

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

favila 2020-10-20T18:44:43.080200Z

so I’m not sure what you are doing

favila 2020-10-20T18:46:13.080400Z

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.spaniel 2020-10-20T18:48:34.080700Z

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

favila 2020-10-20T18:49:18.080900Z

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)

favila 2020-10-20T18:49:54.081100Z

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

favila 2020-10-20T18:51:15.081300Z

on-prem 0.9.5927 added tuples: https://docs.datomic.com/on-prem/changes.html#0.9.5927

kenny 2020-10-20T19:22:41.082600Z

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?

kenny 2020-10-20T19:25:08.083400Z

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

kenny 2020-10-20T19:52:47.083800Z

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

donyorm 2020-10-20T21:36:54.085600Z

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?

favila 2020-10-20T21:39:58.085800Z

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

donyorm 2020-10-20T21:43:28.086Z

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

favila 2020-10-20T21:47:27.086300Z

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]}

donyorm 2020-10-20T21:48:29.086500Z

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

donyorm 2020-10-20T21:51:34.086700Z

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