Fork me on GitHub

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 '{: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


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?


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


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


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


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)


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


brackets in the signature


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


they require that the parameter be bound


It’s a few paragraphs down,


> 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


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.


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?


well a few things


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


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


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.


You need to look at the failure in the nested stack


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


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).