Fork me on GitHub
#datomic
<
2019-06-20
>
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}})))

favila13:06:38

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

favila13:06:19

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

frankitox15:06:57

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 > https://docs.datomic.com/on-prem/ha.html#enabling Does any one know what this means?

ghadi15:06:54

@franquito https://docs.datomic.com/on-prem/aws.html <-- that would be if you're using a Cloudformation template to spin up a datomic transactor automatically

ghadi15:06:48

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

ghadi15:06:40

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

ghadi15:06:59

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

ghadi15:06:23

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

ghadi15:06:38

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

frankitox15:06:12

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.

jaret17:06:20

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. https://docs.datomic.com/on-prem/aws.html#create-cloudformation-template That process takes a transactor properties file and a my-cf.propertied file to generate the final CFT.

jaret17:06:43

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

jaret17:06:06

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

frankitox15:06:29

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.

ghadi16:06:14

@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 https://docs.datomic.com/on-prem/moving-to-cloud.html, 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:

"GroupSize":
  {"Description":"Size of machine group",
   "Type":"String",
   "Default":"2"},

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?

ghadi17:06:34

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

👍 4