Fork me on GitHub
#datomic
<
2016-11-09
>
robert-stuttaford05:11:08

@jaret and @marshall — hi 🙂 is there any chance that Datomic’s backup/restore tooling, when using the s3:// destination, can use the AWS credential profile facility .. e.g. AWS_PROFILE=<my-profile-name> $DATOMIC_PATH/runtime/bin/datomic restore-db “$DATOMIC_PRODUCTION_BACKUPS_S3_BUCKET/<database>" $DATOMIC_URI/<database> with no AWS_ACCESS_KEY or secret set will currently error: com.amazonaws.AmazonClientException: Unable to load AWS credentials from any provider in the chain however AWS_PROFILE=<my-profile-name> aws s3 ls lists the bucket just fine

robert-stuttaford05:11:48

if it’s not supported, i humbly request that it be added. if it is supported, i humbly request guidance on how to use it correctly. thank you 🙂

karol.adamiec17:11:28

guys, need a pointer. has anyone some nice way to work with datomic style identifiers in javascript? what do you do? const name = product[':part/name’]; is unnaceptable in long run. just trying to get some opinions.

karol.adamiec17:11:40

i can map all keys using heuristics so :part/name becomes partName, or write DTO’s (sigh..) by hand.. or?

karol.adamiec17:11:48

fishing for opinions! 😛

lellis18:11:39

I donno if its a good approach but here we change / for _ when this data goes to our response.

robert-stuttaford18:11:57

@karol.adamiec maybe look at how datascript does it (it has a JS api)

timgilbert22:11:26

@robert-stuttaford: I agree this is annoying. FWIW, I've worked around it by having a script that sets AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id) so at least I just have to manage the key in one place

timgilbert22:11:11

Though I guess that's not exactly the same use-case you've got

timgilbert22:11:33

@lellis: I solved that by using EDN as a transport layer and ClojureScript as a consumer 😛

timgilbert22:11:02

...but when I was consuming datomic output with plain JS, I tended to use a JSON translation layer on the server (Clojure) side which converted the EDN to JSON, generally by dropping the namespaces from the keys.

timgilbert22:11:20

Oh,, sorry, that response was for @karol.adamiec

timgilbert22:11:48

IMHO it depends on what you're using on the server side. One option might be using [transit](https://github.com/cognitect/transit-format) which is a performant serialization layer for EDN, but I've never tried using its JS API.

timgilbert22:11:49

I have a completely unrelated question. I'm doing a bunch of queries where I start from one object and then navigate fairly far away from it traversing refs, and I'm wondering if I can get the pull syntax or something else to just retrieve some data at the end instead of needing to reach deep into a nested tree.

timgilbert22:11:18

So for example, I have a project, which has an ID and a floorplan, and the floorplan has an area which has an ID. I've got the area ID and I want the project ID. What I have now is the following but it doesn't seem very elegant:

timgilbert22:11:18

(let [p (d/pull
          db
          [{:area/floorplan [{:floorplan/project [:project/id]}]}]
          [:area/id my-area-id])]
  (get-in p [:area/floorplan :floorplan/project :project/id]))

timgilbert22:11:21

I mean, I can wrap it up in a function, but I'd like to not need to have to specify the key sequence twice

timgilbert22:11:05

Anyways, looking for any more pleasant ways to express this