Fork me on GitHub
#datomic
<
2017-11-22
>
csm01:11:47

I’m getting an error Caused by: com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large (16,642,439 > 4,194,304). You can change this value on the server by setting the 'max_allowed_packet' variable. trying to restore to an Aurora (mysql) database in AWS

ghaskins03:11:08

hi all, im struggling to understand the notion of distinct values and aggregates

ghaskins03:11:44

i have a :db.type/float attribute

ghaskins03:11:30

if I have, say, three entities with [1.2, 2.0, 4.0], running (sum) on that produces the expected 7.2

ghaskins03:11:57

but if I have [1.2, 1.2, 1.2], (sum) produces “1.2” and count produces “1"

ghaskins03:11:03

I dont get what I am doing wrong

ghaskins03:11:37

any help appreciated

karlmikko05:11:49

@ghaskins Datomic generally group bindings on value - treating them as a set of values :with can help with controlling the grouping http://docs.datomic.com/query.html#with

greywolve06:11:19

@ghaskins always remember that Datomic is set based. This has bitten me tonnes of times. You sort of have to drum that into your head. So you if you get identical tuples, and don't use :with then they will appear as one tuple.

ghaskins15:11:54

Yeah, I had read about the :with clause and it wasnt helping me…then I realized that my result was the same with or without the :with clause because I wasnt targeting it properly

ghaskins15:11:12

Once I figured that out, its all working now…but thank you!

chrisetheridge14:11:29

with datomic rules, how would i pass the db as an arg to rules, and then to a function in a rule? like so:

chrisetheridge14:11:56

[(chat-about-subject $ ?subject ?chat)
     [?subject :email ?email]
     [(= (some-fn $ ?chat)
         ?email)]]

chrisetheridge14:11:47

i keep getting “unable to find symbol $” in this context

chrisetheridge14:11:03

or even just pass the db to a function

jfntn15:11:39

Is there a library that can generate specs from a schema tx?

souenzzo19:11:39

/subscribe this topic

jfntn22:11:46

generating specs for scalar attributes is pretty trivial, but refs get complicated pretty quick

kbaribeau19:11:11

Hey all, is there a way to free up resources associated with a datomic connection so that my process doesn't hang on exit? I have a lein task that looks just like this:

(ns slow-lein-because-datomic.core
  (:require [datomic.api :as d])
  (:gen-class))
(defn -main []
  (println "about to connect")
  (d/create-database "datomic:)
  (d/connect "datomic:)
  (println "connected"))
It prints "connected" and then hangs for a very long time before exiting. I thought maybe datomic.api/release would help, but it appears not to, and I can't find many docs around it, or examples.

favila20:11:15

@kbaribeau The hang is caused by the clojure agent pool, which things in datomic use. (This is a general clojure problem, not datomic specific). See docs for datomic.api/shutdown, which may help you.

favila20:11:51

also clojure's shutdown-agents function

kbaribeau20:11:10

Aha, thanks!

jfntn22:11:46

generating specs for scalar attributes is pretty trivial, but refs get complicated pretty quick

jfntn23:11:28

say we a unary ref, its spec would have be an s/keys but it doesn’t feel right to statically define which keys are required and which are optional because we often have different “schemas” on read or write