Ask questions on the official Q&A site at https://ask.datomic.com!
Linus Ericsson 2020-10-05T09:45:47.231300Z

In on-prem (maybe also on client) you should use the :tempids key in the transaction result, there and use datomic.api/resolve-tempid to resolve the tempids to realized entity-ids.

onetom 2020-10-05T11:57:23.235300Z

we have upgraded clojure cli tools x.x.x.590 to, then the following error appeared:

$ clj -Srepro -e "(require 'datomic.client.api)"
WARNING: When invoking clojure.main, use -M
Execution error (FileNotFoundException) at clojure.core.async.impl.ioc-macros/eval774$loading (ioc_macros.clj:12).
Could not locate clojure/tools/analyzer__init.class, clojure/tools/analyzer.clj or clojure/tools/analyzer.cljc on classpath.
i think im on the latest dependencies in my ./deps.edn file:
org.clojure/clojure                     {:mvn/version "1.10.1"}
  com.datomic/client-cloud                {:mvn/version "0.8.102"}
  com.datomic/ion                         {:mvn/version "0.9.48"}

onetom 2020-10-05T12:50:46.241500Z

I tried it with both nixpkgs.jdk8 and jdk11. I tried it with and without the deps overrides recommended by the latest ion-dev push operation. the error is always the same. I have no other dependencies specified and still get this error. I guess I can specify this missing dependecy explicitly, but it feels like I'm doing something wrong, if such a bare bones ion project doesn't work out of the box.

alexmiller 2020-10-05T13:10:06.242500Z

Can you share your full deps.edn?

onetom 2020-10-05T13:36:32.242700Z

  ["src" ;"rsc" "classes"

   org.clojure/clojure                     {:mvn/version "1.10.1"}
   com.datomic/client-cloud                {:mvn/version "0.8.102"}
   com.datomic/ion                         {:mvn/version "0.9.48"}
   ;org.clojure/data.json                   {:mvn/version "0.2.6"}
   ;http-kit/http-kit                       {:mvn/version "2.5.0"}
   ;metosin/reitit-ring                     {:mvn/version "0.5.6"}
   ;org.clojure/tools.analyzer              {:mvn/version "1.0.0"}

   ;; Deps to avoid conflicts with Datomic Cloud
   ;; commons-codec/commons-codec             #:mvn{:version "1.13"},
   ;; com.fasterxml.jackson.core/jackson-core #:mvn{:version "2.10.1"},
   ;; com.amazonaws/aws-java-sdk-core         #:mvn{:version "1.11.826"},
   ;; com.cognitect/transit-clj               #:mvn{:version "0.8.319"},
   ;; com.cognitect/s3-creds                  #:mvn{:version "0.1.23"},
   ;; com.amazonaws/aws-java-sdk-kms          #:mvn{:version "1.11.826"},
   ;; com.amazonaws/aws-java-sdk-s3           #:mvn{:version "1.11.826"}

   {:url "<s3://datomic-releases-1fc2183a/maven/releases>"}}


    {nubank/matcher-combinators {:mvn/version "3.1.3"}
     lambdaisland/kaocha        {:mvn/version "1.0.700"}}}}

onetom 2020-10-05T13:40:55.242900Z

i tried brew install clojure and run /usr/local/bin/clojure directly; same result. i haven't tried it under linux yet, but it feels like a tools.deps.alpha issue.

alexmiller 2020-10-05T13:43:54.243100Z

I don't think the os matters so no reason to do that

onetom 2020-10-05T13:46:18.243300Z

i just retried again on a different machine: no error:

$ /nix/store/0v7kwppxygj3wln9j104vfi1kx21fssj-clojure- -Srepro -e "(require 'datomic.client.api)"
analyzer error:
$ /nix/store/9g4xqjpzi7vkr5a5n2q3fd1cyymvh68r-clojure- -Srepro -e "(require 'datomic.client.api)"

onetom 2020-10-05T13:49:22.243500Z

these are the differences in the dependency tree:

$ diff -u &lt;(/nix/store/0v7kwppxygj3wln9j104vfi1kx21fssj-clojure- -Srepro -Stree) &lt;(/nix/store/9g4xqjpzi7vkr5a5n2q3fd1cyymvh68r-clojure- -Srepro -Stree)
--- /dev/fd/63	2020-10-05 21:48:46.147069426 +0800
+++ /dev/fd/62	2020-10-05 21:48:46.147513695 +0800
@@ -31,10 +31,6 @@
     com.datomic/client-api 0.8.54
       org.clojure/core.async 0.5.527
         org.clojure/tools.analyzer.jvm 0.7.2
-          org.clojure/tools.analyzer 0.6.9
-          org.clojure/tools.reader 1.0.0-beta4
-          org.clojure/core.memoize 0.5.9
-          org.ow2.asm/asm-all 4.2
     com.cognitect/http-client 0.1.105
       org.eclipse.jetty/jetty-http 9.4.27.v20200227
         org.eclipse.jetty/jetty-io 9.4.27.v20200227

alexmiller 2020-10-05T13:54:38.243700Z

I'm looking at it, give me a bit

alexmiller 2020-10-05T14:50:33.244100Z

this is a tools.deps bug - it's pretty subtle and will take me a bit to isolate and fix properly but adding a top level dep on org.clojure/core.async 0.5.527 should be a sufficient workaround for the moment

onetom 2020-10-05T14:50:50.244300Z

thank you!


@oscarlinusericsson yep, and I do this. But anyway I need a criteria, are some ids temporary, for resolving it that way. Or you suggest to resolve any id as temporary first, and if it is not resolved this way (or throws an exception), then it probably is a real id and trying to use it an non-temporary?

onetom 2020-10-05T14:53:58.247400Z

with that core.async, it worked on my side too

kennytilton 2020-10-05T14:58:59.250400Z

@nando I am a Datomic noob myself, but I got curious about the proposed enhanced doc (+1 on that, btw) and how :with might work and ran a little experiment:

(d/q '[:find  ?year
         :with ?language
         :where [?artist :artist/name "Bob Dylan"]
         [?release :release/artists ?artist]
         [?release :release/year ?year]
         [?release :release/language ?language]]
    db) ;; =&gt; [[1968] [1973] [1969] [1970] [1971]]
So to my unwitting eyes, the :with per se does not block collapsing of duplicates: rather, one must concoct a :with clause based on domain knowledge to force a bag with the desired population over which to aggregate. Maybe? 🀷

Linus Ericsson 2020-10-05T15:00:15.250500Z

if you create your ids with datomic.api/tempid then you can check if they are an instance of datomic.db.DbId. But that requires your code to use the tempid function, of course. If you transact data with tempids, that already can be resolved to entities (through external indexes and more), the tempids can be resolved to already existing entities, yes. Tempids do not have to create new entities, they can be resolved to already existing entities.

favila 2020-10-05T15:11:09.253300Z

The columns in the initial set are with+find, (in this case ?year ?language), then aggregation happens, then the :with columns are removed (in this case ?language) leaving a bag

favila 2020-10-05T15:11:47.253800Z

maybe it’s easier to think of it as :find ?year ?language :removing ?language

favila 2020-10-05T15:12:17.254500Z

instead of :find ?year :with ?language

nando 2020-10-05T15:15:29.257Z

@hiskennyness I can only respond by saying that I think :with is a very important clause to understand, and I'm not sure I fully understand it yet. Your example is the first I've seen targeting an attribute rather than an entity id. I don't have sufficient grasp of the inner workings of datomic or concept behind :with to make a guess how that works, but I'm easily confused.

kennytilton 2020-10-05T15:24:38.257300Z

You remind me of this gem: https://ace.home.xs4all.nl/Literaria/Poem-Graves.html. I have been toying with doing a ground-up Datomic for the Easily Confused tutorial series, maybe I should do it as I struggle up my own learning curve.

nando 2020-10-05T15:25:58.257500Z

That's a very helpful explanation.

nando 2020-10-05T15:40:23.257700Z

If you do a tutorial series, of course please send the link!

timo 2020-10-05T16:29:51.258500Z

how do I create a client with datomic.client.api with datomic free?

timo 2020-10-05T17:18:40.258900Z

can I even use datomic.client.api with datomic free?

Michael W 2020-10-05T17:21:05.259800Z

Yes you have to run a peer server with datomic free to do that. See: https://docs.datomic.com/on-prem/peer-server.html

marshall 2020-10-05T17:21:22.260300Z

@timok Datomic free does not support peer server

marshall 2020-10-05T17:21:31.260700Z

@timok You should look at dev-local: https://docs.datomic.com/cloud/dev-local.html

marshall 2020-10-05T17:21:39.261100Z

^ no cost way to use datomic client library locally

Michael W 2020-10-05T17:21:47.261400Z

I have it running a peer server here...

marshall 2020-10-05T17:22:10.261900Z

Datomic Pro Starter, which is free (no cost) does include peer server

marshall 2020-10-05T17:22:28.262500Z


Michael W 2020-10-05T17:22:40.262800Z

Ok so I am running that not free then. Sorry for the confusion.

timo 2020-10-05T17:23:58.263100Z

alright, thanks...will try dev-local then

onetom 2020-10-05T22:38:13.266800Z

i would like to implement some cognito triggers, using ions. how can i see what payload does an api service calls an ion with? can i "log" such info to some standard location easily? for example, where can i see, if i just clojure.pprint/pprint something in an ion?

alexmiller 2020-10-05T23:33:43.267100Z

hey, a new prerelease of clj is out if you'd like to test it -, will promote to stable after a bit more use

alexmiller 2020-10-05T23:34:33.267300Z

and I guess I implied but should say that it fixes this problem - thanks for the report, it would have been challenging to find this otherwise!