Fork me on GitHub
Brian Abbott05:06:38

Frustration. I have the following query:

Brian Abbott05:06:29

(def get-dev-user-q '[:find ?e :where [?e :user/email <mailto:[email protected]|[email protected]>]])) (defn mig-user-role-on-dev-user [conn] (let [devuser-id (d/q get-dev-user-q (d/db conn))] (d/transact conn {:tx-data {:db/id (ffirst devuser-id) :user/role 1}})))


Your tx data is a map not a vector. Should be [{:db/id ...}]


Stepping back: why query at all? Either user email is unique, in which case why not mark it so and use :db/id [:user/email “whatever”], or what you are doing is unsafe because you are essentially picking a user at random that happens to have the same email

Brian Abbott05:06:47

it throws this error:

Brian Abbott05:06:04

Caused by: java.lang.IllegalArgumentException: Don't know how to create ISeq from: xhealth_web.db.migrations$mig_user_role_on_dev_user

Brian Abbott05:06:27

I have decided that my brain for some reason does not possess the processing power to solve this. 😞

Brian Abbott05:06:44

Does anyone know what my problem might be??

Brian Abbott05:06:56

(with the code that is - not my head) 😛

Brian Abbott05:06:49

arent I to put datalog querys in a list ahead of time i.e. '

Brian Abbott06:06:11

And.... a lesson in.... arrogance of mind? or rigidity of mind perhaps.... the first part of the stack trace I dismissed as being... not relavant -- it was someone elses code - it had to work correctly. But, how we roll through our migrations, usually its data-attributes not functions that perform queries and subsequent updates.... So, in the config I had to handle mine slightly differantly.....


I'm going through Datomic's HA documentation, it says something about a "Datomic transactor appliance", in context: > If you are using the Datomic transactor appliance, you can run two transactors in a single stack by setting a property in your CloudFormation template > Does any one know what this means?


@franquito <-- that would be if you're using a Cloudformation template to spin up a datomic transactor automatically


you can tweak a property and get two transactors running in HA


But if you're on AWS, and haven't chosen how to run datomic yet, I would encourage you to look at Datomic Cloud


(disclaimer: I work for Cognitect, but not on the Datomic team)


I think there is less stuff to manage with Datomic Cloud, even though the total number of pieces is greater


(but on-prem and cloud are not drop-in replacements for each other)


Oh, thanks for the clarification. I'm running Datomic in AWS, but I don't think that whoever deployed it used the Datomic Cloud facilities. I do have a CloudFormation template, but the property to adjust the amount of transactors is called GroupSize instead of aws-autoscaling-group-size.


Hi @franquito the difference you are seeing is an artifact of the provided CFT process. For running AWS in on-prem we supply a CFT process, described here. That process takes a transactor properties file and a my-cf.propertied file to generate the final CFT.


In the file you supply a aws-autoscaling-group-size.


If you have your own CFT then yes, you can modify with the groupsize property.


Thank you! I double checked just in case. Apparently we did use the CFT sample Datomic provides and it transforms the aws-autoscaling-group-size property to a parameter GroupSize of the template.


@jaret might know more ^

Jacob Ford17:06:41

Hey all, I work with @franquito. Following up on his question: We're pretty deep in On-Prem now even though it is on AWS—it's already running in production backed with DynamoDB. Unless I'm misunderstanding, it seems at this point it'd be pretty painful to switch to Cloud. But my question is: does aws-autoscaling-group-size in the CloudFormation .template file translate directly to GroupSize in the Template JSON I'm seeing in AWS CloudFormation console now, after it was successfully created? Excerpt from our CloudFormation Template:

  {"Description":"Size of machine group",

Jacob Ford17:06:20

Or is the lack of aws-autoscaling-group-size in my Template JSON a sign that we've improperly configured our cluster for High Availability?


Speaking without actually verifying: it should correspond to the ASG size

👍 4