Fork me on GitHub
#datomic
<
2018-10-31
>
stijn08:10:15

@kenny we have a support ticket logged for that problem (although we call API gateway, but get the same error returned in the body of the HTTP response). @jaret can tell you more about the status.

kenny18:10:37

I opened a ticket as well.

joshkh15:10:08

@stijn not sure if it's related, but to add to kenny's comment, i get this error the first time i run an ion from API Gateway: java.io.IOException: Premature EOS, presumed disconnect

joshkh15:10:53

first time after each deployment, and no matter how long i wait to invoke it

stopa18:10:19

Hey ya'll -- noob datomic question: I have a bunch of records called "intents". These should have very rarely been updated in the last 1-2 years. I want to find all the records that have been updated in the last 2 years

favila18:10:59

"record" means? "updated" means?

favila18:10:36

your query seems consistent with "record" meaning entity with :intent/uuid and "updated" meaning any assertion/retraction about that entity at all

stopa18:10:17

I'm reading through time-rules https://github.com/Datomic/day-of-datomic/blob/master/tutorial/time-rules.clj and so far made something like this

(d/q '[:find (max ?t) (max ?inst)
       :in $ %
       :where
       [?e :intent/uuid]
       (entity-at ?e ?tx ?t ?inst)]
     (d/history (db)) time-rules)
query is still running as I write this If someone can help me craft this query would appreciate it 🙂

ro618:10:35

Has anyone come up with fns/rules to help detect when you're about to transact schema that would violate http://blog.datomic.com/2017/01/the-ten-rules-of-schema-growth.html? I'm aware of Conformity and the other migration libraries, but I'm more interested in detecting breaking schema changes.

kenny19:10:26

@robert.mather.rmm I wrote this to detect breaking changes in our schema.

ro619:10:33

Beautiful! Thank you sir. Is db-schema-attributes dynamically bound? Or maybe private to your code and defined elsewhere?

kenny19:10:11

Oops. Edited the snippet.

kenny19:10:31

Note that this marks the automatic schema alterations Datomic can perform as breaking.

ro619:10:21

Got it, thanks.

ro619:10:33

Beautiful! Thank you sir. Is db-schema-attributes dynamically bound? Or maybe private to your code and defined elsewhere?

schmee20:10:40

how can I check if an entity is a component of another entity?

favila20:10:56

Check if there's an assertion that connects the two entities via an is-component attribute

favila20:10:09

example rule:

[(is-component-entity? [?component] ?owner)
 [?component ?a ?owner]
 [(datomic.api/attribute $ ?a) ?attr]
 [(:is-component ?attr)]]

schmee20:10:48

neat, thank you!

favila20:10:40

that attribute call can be just [?a :db/isComponent true] instead

ro621:10:34

Transaction functions should return a seq of :db/{add|retract} statements right? So what's the right syntax for invoking an installed tx fn? 1. (d/transact conn {:tx-data '(my.namespace/my-fn! arg1 arg2)}) 2. (d/transact conn {:tx-data ['(my.namespace/my-fn! arg1 arg2)]}) 3. Something else?

ro621:10:08

But when I call using that style, I get this error: clojure.lang.ExceptionInfo: clojure.lang.LazySeq cannot be cast to java.lang.Number

ro621:10:31

I can test locally like: (d/transact conn {:tx-data (my.namespace/my-fn! db-val arg1 arg2)}) and it works fine

ro621:10:52

nevermind, the problem was elsewhere

ro622:10:55

it was because arg2 to my tx fn was a function call itself that needed to eval before sending to the transactor, and I forgot that quoting (`'()`) would recursively prevent evaluation inside the list. I switched to a vector and just quoted the tx fn symbol and it worked.

ro622:10:32

my mind isn't used to mixing local and remote evaluation like that