Fork me on GitHub
#datomic
<
2023-05-25
>
Can10:05:10

Hello Where can I find very basic releational datomic schema to study and inspect, I checked mbrainz and max datoms some schemas but they are came to me very comfusing and complex.

stopa14:05:02

This isn't too basic, but this project in general really helpful for studying datomic + clojure -> https://github.com/PrecursorApp/precursor/blob/master/src/pc/datomic/schema.clj

Can21:05:26

Thank you so much, I will take a look on it 🙂

Dave14:05:12

https://schema-cartographer.com/ is a great tool for creating your own via a cartographer file (what you see and manipulate in the browser) and outputting that file to a datomic tx file. You can keep it small and simple and related to your particular domain namespaces which I find very helpful.

👀 2
Drew Verlee19:05:53

Why do these queries return different results?

(d/q '[:find ?n
       :where
       [?n :asset-tag/id #uuid "579aba41-21b3-4acd-9715-f3ba11b5777e"]]
     (./db))
;; => #<java.util.HashSet@86b9d50 [[316659348802923]]>

(d/q '[:find ?n ?a
       :where
       [?n ?a #uuid "579aba41-21b3-4acd-9715-f3ba11b5777e"]]
     (./db))
;; => #<java.util.HashSet@2f6fb0e5 []>
I expected the later to be the same as the first. I assume this is some kind of "don't scan the full db" thing, but shouldn't it throw then?

favila19:05:09

I would also expect the second one to throw

Drew Verlee21:05:39

Maybe it is and it's getting eaten... This is something i have noticed that I'm confused by in my dev env... We're wrapping the Datomic functions so my examples are misleading..(i forgot myself for a minute) Thanks for the input.

souenzzo10:05:20

datomic-client and datomic-peer (maybe datomic on-prem vs cloud) have distinct results on this query @U09R86PA4 i dont remember exactly which combination results in which behavior. @U0DJ4T5U1 this query should do the job

(d/q '[:find ?n ?a
       :where
       [?a :db/ident]
       [?n ?a #uuid "579aba41-21b3-4acd-9715-f3ba11b5777e"]]
  db)

Drew Verlee15:05:25

thanks souenzzo!

frankitox19:05:31

Hello! I'm having trouble downloading the datomic-pro jar inside a Docker container

✅ 2
frankitox19:05:18

I'm using deps tools, the error message is

{:type java.util.concurrent.ExecutionException,                                                                      
    :message                                                                                                            
    "org.h2.jdbc.JdbcSQLException: Connection is broken: \"java.net.ConnectException: Connection refused (Connection ref
used): localhost:4335\" [90067-171]",                                                                                   
    :at [java.util.concurrent.FutureTask report "FutureTask.java" 122]}

frankitox19:05:02

I've tried publishing ports 4334 through 4336 to no avail

frankitox19:05:22

Just realized it did download the jar (it was the last one to be downloaded). The error happens when trying to run the actual code, which is a whole different thing