Fork me on GitHub
#datomic
<
2016-01-26
>
currentoor01:01:02

I'm using conformity for migrations but I'm a little confused about the API. Based on the README it takes a map of the form

{:migration/143424234_add_user {:txes [[...]]}
 :migration/143424235_modify_user {:txes [[...]]}}
But the map is not ordered so how does it now what order the migrations should be applied?

currentoor01:01:52

Or should I pass in a new map for each migration?

taylor.sando01:01:55

There is a requires key in addition to :txes that you can supply the name of the prequisites, so if modify user depends on add_user, you'd put :add_user in the :requires map for modify_user

donaldball03:01:49

I have a general usage pattern question, I’ll try to summarize in prose. I have a query that returns a bunch of musicians. I’m also going to be interested in the publishers of any albums the musicians have released, but have no guarantee that every musician has done so, and don’t want to exclude them from the results. In sql, I’d balance the cost of the repeated musician data against the cost of another query to determine my execution strategy. In datomic, it’s not clear if a. it would even be possible to do this in a single query or b. if there’s any benefit from doing this in a single query.

Ben Kamphaus03:01:55

@donaldball: for your use case I would use a pull expression. As described here - http://docs.datomic.com/best-practices.html#use-pull-to-retrieve-attribute-values - pull expressions don’t limit results missing attributes/ref traversals, etc. Documentation on using pull expressions is here: http://docs.datomic.com/query.html#pull-expressions

donaldball03:01:21

Thanks, that does seem like the tool for which I was looking.

donaldball04:01:16

[:find (pull ?musician [:db/id :album/_artist])] gives me the musicians and their sets of albums, if any, but I don’t really want the albums here, I just want the publishers

Ben Kamphaus04:01:37

@donaldball: you can nest patterns to retrieve publishers from albums, http://docs.datomic.com/pull.html#nesting

donaldball04:01:34

Ah, so you can, thanks again

timgilbert20:01:10

Hi all... I'm not having any luck getting a CloudFront instance to deploy because the EC2 instances keep failing their health checks and being restarted. Anything obvious I should look for?

timgilbert20:01:21

The instances are reporting "Client.InstanceInitiatedShutdown: Instance initiated shutdown"

timgilbert20:01:59

...then if I try to launch the AMI in an EC2 instance I set up manually I can't seem to ssh to it

Ben Kamphaus20:01:19

@timgilbert: likely culprits are (a) inadequate permissions for transactor role, (b) incompatible memory settings, (c) unsupported instance type *e.g. one without a file system, some more details here in the “transactor fails to start” section — http://docs.datomic.com/deployment.html#troubleshooting

timgilbert20:01:52

Thanks again @bkamphaus, will look through that