Fork me on GitHub
#datomic
<
2016-08-25
>
karol.adamiec14:08:52

hi, how do i find proper ami for datomic in my region? i am trying to use https://github.com/mrmcc3/tf_aws_datomic

karol.adamiec14:08:26

is datomic peer and transactor bound to specific ami?

robert-stuttaford15:08:31

@karol.adamiec i suppose you'll need to use the commands on http://docs.datomic.com/aws.html to generate some CFN and copy the AMI out of there

robert-stuttaford15:08:05

i see that the changelog lists regions that are supported Transactor AMIs are now available in all AWS regions that support DynamoDB: us-east-1, us-west-1, us-west-2, eu-west-1, ap-northeast-1. and ap-southeast-1.

karol.adamiec15:08:58

rather new to this so i will have to sum it up to make sure i get it 🙂

karol.adamiec15:08:12

peer is not bound to ami, should work with any linux amazon image

karol.adamiec15:08:38

transactor needs specific ami image, to find it one chould run aws commands from linked article?

robert-stuttaford15:08:04

yes. or wait for @marshall or @jaret to point us all to a table of region + ami codes 🙂

andrewhr17:08:24

you could make some searchs on AWS console to discover the AMI id

andrewhr17:08:11

there is a new feature on terraform 0.7 to use this as a data-source... I made a proof of concept here and it worked quite well

andrewhr17:08:06

I planned to port and make a PR to the this recipe, but didn't managed to take the time yet

colindresj18:08:48

Hey all, if I’ve got a message entity with a topics attribute which is a ref attribute of cardinality many, and I’ve got a project entity, how can I write a pull pattern that allows me to get all messages where a given project is a topic?

bkamphaus18:08:04

if you want a set of things filtered by some criteria - i.e. the selection for which some constraint holds, you’ll need to use query (pull is projection, essentially)

colindresj18:08:16

@bkamphaus I was planning to write the pull inside of a query, not use the pull api directly, does that change anything?

bkamphaus18:08:45

You'll just need to use the pull expression to get the attributes of interest and the where clause to select the entities (projects that are topics).

colindresj18:08:41

That makes sense, but what if I want to return a project that includes those very messages where it was reference, kind of like

{:name “My project”
 :messages [{:text “Msg text”}]}
?

colindresj18:08:07

Would that be done as two separate queries that are then merged in clojure-land?

bkamphaus18:08:49

caveat: not tested. Could also just put pull portions in where clause if you’re ok with those limiting results (i.e. don’t need to keep projects in results if no project name or messages in results if messages don’t have text.

[:find (pull ?p [:project/name]) (pull ?m [:message/text])
:in $ ?t
:where
[?p :project/topic ?t]
[?p :project/message ?m]]
inputs: database, topic

jaret19:08:49

@robert-stuttaford @karol.adamiec We do not have a table of regions and AMI codes. Robert’s method of generating CFN and copying the AMI is the way to get the code.

zane20:08:37

Is this a bug?

dev> (d/q '[:find (pull ?eid [:db/id "*"]) .
       :in $
       :where
            [?eid :db/ident :state/CA]]
     (d/db (:core moyo.datomic/db-connections)))
{":db/id" 17592186045434, ":db/ident" :state/CA}

dev> (d/q '[:find (pull ?eid [:db/id *]) .
       :in $
       :where
            [?eid :db/ident :state/CA]]
     (d/db (:core moyo.datomic/db-connections)))
#:db{:id 17592186045434, :ident :state/CA}

zane20:08:12

Specifically, whether or not you pass in "*" or '* changes the type of keys returned by a pull query.

jgdavey20:08:52

That is by design, I believe. The ”*” version is a convenience for e.g. Java clients

zane20:08:32

I would imagine that the Java client would handle that kind of translation.

jgdavey20:08:43

It can, but getting strings back immediately is sometimes desired

jgdavey20:08:11

Not sure where I got that impression, but my understanding is that ”*” and * have those differing semantics.

zane20:08:31

I see. Having that happen implicitly depending on the type of * passed in seems like it's an easy way to confuse consumers.

jgdavey20:08:54

I think it surprised me the first time I saw it.