This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-10
Channels
- # announcements (3)
- # babashka (3)
- # beginners (83)
- # calva (1)
- # cider (19)
- # clojure (131)
- # clojure-austin (4)
- # clojure-dev (3)
- # clojure-europe (49)
- # clojure-greece (2)
- # clojure-italy (8)
- # clojure-losangeles (18)
- # clojure-nl (14)
- # clojure-poland (1)
- # clojure-uk (65)
- # clojurescript (28)
- # core-async (7)
- # core-logic (3)
- # cursive (2)
- # data-science (1)
- # datomic (98)
- # defnpodcast (1)
- # figwheel-main (6)
- # fulcro (95)
- # graphql (5)
- # hoplon (7)
- # kaocha (1)
- # lein-figwheel (6)
- # luminus (1)
- # nyc (1)
- # off-topic (21)
- # pedestal (1)
- # quil (8)
- # re-frame (15)
- # reagent (106)
- # reitit (15)
- # shadow-cljs (158)
- # sim-testing (1)
- # spacemacs (17)
- # sql (25)
My local SOCKS connection is suddenly not connecting. None of the AWS setup changed. Any tips on how to troubleshoot? How would I confirm that the primary stack is running?
With Datomic analytics, does cardinality-many additional tables, work with column joins?
In the example, in the product_x_tags
table and tags
was a ref, how can I get the the attributes of tags
, instead of it’s eid?
@danie what is your schema and what is your metaschema? I am not sure I entirely follow, are you trying to have another column join from a card many on the tags side?
i found this blog post re: tx report queue https://blog.datomic.com/2013/10/the-transaction-report-queue.html
link works for me
seems like it's getting read in the preview above too
real javadoc link: https://docs.datomic.com/on-prem/javadoc/index.html
https://docs.datomic.com/on-prem/clojure/index.html#datomic.api/tx-report-queue
maybe I am looking for wrong thing. eg use case: send an email to customer for every order placed.
I’ve considered wrapping d/transact
in a function that would simply put tx results onto a queue…“roll your own tx queue” so to speak. Obviously then other parts of the code would need to use this wrapped function. Never tried it, but it seems like it would be an option for cloud users.
@U6GFE9HS7 what does queue mean here results onto a queue
@UNWLRR74Y either a core.async queue/channel to keep it simple and in-process, or potentially a SQS queue if you need something more durable. Kafka is probably overkill.
Ideally something async. You likely don’t want writers being blocked by the transaction queue.
ok. sounds like I'd have to have to poll tx manually and keep track of my position somewhere https://docs.datomic.com/cloud/time/log.html
my current thinking is that is not possible because when you transact data you have no way to know if they data moved underneath you since you read it. There is cas but thats only for a single attribute.
it depends on what you need. datomic transactions are really set operations, so they can compose. it’s only if you really need a specific computed write from a read that you reach for CAS or a transaction function
when the user adds or removes a tag, do you a) read all the tags, remove the tag, and re-assert the entire set b) only add the tag?
sometimes you want A, in which case yes you need a tx function because you want the set’s final value to be exactly what you stated. (It’s a further question whether you want to fail and recompute if someone else wrote in the meantime, or if you want the last writer to win always)
but sometimes you want B, in which case it doesn’t matter what changes happened to the set in the meantime, the end result of adding your tag will be the same
gotcha. I was thinking of super typical ecommerce 101 buy a product flow.
1 . check invenotry count x
2. create order record
3. sen inventory count to x-1
e.g. create order record but mark inactive, then activate+change inventory count using two CAS
you can also use CAS to assert no-change, e.g. [:db/cas ent attr 1 1] to ensure the value is still 1
all that said, do make and use tx functions! but maybe you only need a smaller set of primitive functions which do precondition checking or db/ensure for postcondition checking; instead of a function for every single business operation
My team doesn't seem too comfortable with adopting both datomic and ions in one go. So I was researching if its even possible to write apps without tx functions.
Anyone have a library for turning a full map into a Datomic transaction, including retractions and additions from the current entity in the DB?
@kenny I recently just rolled my own. A bit of a pain but I couldn't find a clean solution although perhaps I missed one
Can anyone point me in the right direction for how to give my Datomic Cloud s3 access to a bucket I've created? I'm getting this error when trying to fetch an object from my bucket which makes me think it has to do with permissions {:Error {:Code \"AccessDenied\", :CodeAttrs {}, :Message \"Access Denied\", :MessageAttrs {}, :RequestId \"<reqId>\", :RequestIdAttrs {}, :HostId \"<hostId>\", :HostIdAttrs {}}, :ErrorAttrs {}, :cognitect.anomalies/category :cognitect.anomalies/forbidden}
I figured I’d end up needing to write it myself. Kinda surprised a lib out there doesn’t have a fn for it already. I also searched and couldn’t find one.
@kenny @brian.rogers that use-case is inherently racey unless done within a tx function
@brian.rogers permission for Ions?
if you make it a generic helper then someone uses in a situation where the assumption of a race isn't understood, it wouldn't be fun
The idea of a “full-map” transaction seems like it could be extended to support automatic ordering of cardinality many attributes.
but if you don't account for the basis of the tx-data you generate being old, it will be a nasty transaction
Sure. Just a lot of interesting things you can do with a full-map transaction. Curious if there’s a reason no one has written a library for this sort of thing. Seems super useful, unless I’m missing something.
I think there are better ones out there now @kenny but this was mine: https://gist.github.com/favila/8ce31de4b2cb04cf202687c6a8fa4c94
there has been discussion about a “make it look like this” tx function off and on here, maybe the archives can help
e.g. you have a version-like attr on entities and you can say: update all this stuff as long as the cas succeeds
This is probably app dependent. In some cases, if the data has changed, I want to tell the user something has changed so they can reevaluate their action.
Perhaps that is what makes a general version of this function difficult — a bit too use case dependent.
basically if you update your stack(s) with a reference to the policy you created, then the Datomic compute nodes (whether the primary or query groups) will have augmented capabilities
Kk. Well I'm not quite sure where my code is falling down permissions wise. The docs list 4 things that I need to do: 1. use default credentials provider chain. I am making a client this way https://github.com/cognitect-labs/aws-api/blob/master/examples/s3_examples.clj#L12 and my understanding is that without specifying credentials, it is using the default ones. Am I right so far on that?
@brian.rogers DM me your policy if you want -- it's probably missing some sort of S3 permission if it's 403'ing
Does Datomic support "union" pull queries as described here? https://edn-query-language.org/eql/1.0.0/specification.html#_unions