Fork me on GitHub
#datomic
<
2020-01-24
>
luiseugenio14:01:11

Hi, is it possible to create a tuple (composite key) that refers to a inverse key (from a parent that has this entity as subcomponent)?

{
:db/ident :subcomponent-entity/composite-key 
:db/valueType :db.type/tuple 
:db/tupleAttrs [:parent/_subcomponent-entities :subcomponent-entity/id] 
:db/cardinality :db.cardinality/one 
:db/unique :db.unique/identity
}

Sam DeSota17:01:31

I'm considering deploying a web app api I've developed locally via Datomic Ions, currently I'm using a boot for deps + a number of tasks. It looks like I need to specify my deps via the clojure cli EDN format in order to deploy via clojure -iAion-dev, is there an easy way to use boot for deps + tasks while deploying to ion?

Alex Miller (Clojure team)18:01:38

using deps is always ultimately just running a java command line

👍 4
Alex Miller (Clojure team)18:01:49

so there's no reason you can't do the equivalent

Alex Miller (Clojure team)18:01:32

it would look something like java -cp <ion-dev-deps> clojure.main -m datomic.ion.dev '{:op :push}'

Alex Miller (Clojure team)18:01:06

where <ion-dev-deps> are the transitive deps from com.datomic/ion-dev 0.9.247 (you will also need maven repository "datomic-cloud" {:url "<s3://datomic-releases-1fc2183a/maven/releases>"})

Alex Miller (Clojure team)18:01:32

I don't know what the best way to make that happen with boot is, but should be doable

maxt18:01:22

I'd like to create a rule that gives me all the passed entity and all entities it refers too, but I'm not able to get the "same" rule to work

'[[(self-or-refers-to ?e1 ?e2)
   [(= ?e1 ?e2)]]
  [(self-or-refers-to ?e1 ?e2)
   (refers-to ?e1 ?e2)]
  [(refers-to ?parent ?entity)
   [?parent ?ref ?entity]
   [?ref :db/valueType :db.type/ref]]
  [(refers-to ?parent ?entity)
   (refers-to ?parent ?e)
   (refers-to ?e ?entity)]]
Using = gives me [?e2] not bound in expression clause: [(= ?e1 ?e2)] How would I go about that?

favila19:01:13

I think you want [(identity ?e1) ?e2] .

favila19:01:42

it may be easier to think of it using [] to enforce boundedness

favila19:01:22

(self-or-refers-to [?anchor-e] ?reachable-e)

favila19:01:16

in practice datomic rules can’t be run backwards efficiently, so it’s easier to think of input and output params (although you can bind the output params as a kind of filter)

maxt19:01:17

In the call or the rule signature? Not yet grokking what you say

favila19:01:29

brackets in the signature

maxt19:01:15

What does the brackets imply? I.e. is it called something that I can read about?

favila19:01:40

they require that the parameter be bound

favila19:01:08

It’s a few paragraphs down,

favila19:01:14

> We can require that variables need binding at invocation time by enclosing the required variables in a vector or list as the first argument to the rule

maxt19:01:56

Thank you! That paragraph seems to be missing from the cloud docs, but supposedly it works the same. It's still there in the example.

maxt19:01:30

Using identity works great, really didn't think of that.

[(self-or-refers-to [?e1] ?e2)
 [(identity ?e1) ?e2]]
It works both with and without the brackets. Would the brackets make it more efficient, or is in this case more of a documentation think to signal that we expect it to be bound?

favila19:01:08

well a few things

favila19:01:31

1. this particular rule can’t even run backwards, so it’s a guard and documentation

favila19:01:05

2. I think it helps to clarify what parts of the fn are considered input vs output

maxt19:01:22

Ok! Thank you for taking your time explaining!

John Conti23:01:06

I am trying to start my first AWS Solo instance. So beware the n00b. I have looked at the troubleshooting page but do not see why my stack is failing along with autoscaling alerts:

John Conti00:01:16

The problem was there are timeouts that default to 10 minutes in the template launch forms. Changing those looks like it is helping.

marshall01:01:52

You need to look at the failure in the nested stack

marshall01:01:16

You have to choose deleted or failed stacks in the stack console

marshall01:01:55

Then look into the nested stack that failed and find the specific error

John Conti23:01:36

Seems like it creates the storage, tries to scale it and dies, I believe. I have every permission under my account (full admin).