This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-16
Channels
- # adventofcode (76)
- # aleph (1)
- # aws (2)
- # beginners (101)
- # boot (1)
- # boot-dev (1)
- # calva (25)
- # cider (12)
- # cljs-dev (29)
- # clojure (214)
- # clojure-europe (1)
- # clojure-nl (5)
- # clojure-spec (1)
- # clojure-uk (6)
- # clojurescript (155)
- # data-science (1)
- # datomic (48)
- # figwheel-main (5)
- # immutant (1)
- # leiningen (11)
- # nrepl (2)
- # off-topic (24)
- # pathom (2)
- # pedestal (2)
- # portkey (8)
- # protorepl (5)
- # re-frame (2)
- # rum (4)
- # shadow-cljs (21)
hi 🙂 trying to get datomic cloud all set up but it keeps failing 😞 anybody else had problems with the CloudFormation setup ?
15:06:01 UTC+0200 ROLLBACK_COMPLETE AWS::CloudFormation::Stack myapp
15:06:00 UTC+0200 DELETE_COMPLETE AWS::CloudFormation::Stack StorageF7F305E7
15:05:26 UTC+0200 DELETE_IN_PROGRESS AWS::CloudFormation::Stack StorageF7F305E7
15:04:58 UTC+0200 ROLLBACK_IN_PROGRESS AWS::CloudFormation::Stack myapp The following resource(s) failed to create: [StorageF7F305E7]. . Rollback requested by user.
15:04:58 UTC+0200 CREATE_FAILED AWS::CloudFormation::Stack StorageF7F305E7 Embedded stack arn:aws:cloudformation:us-east-1:772499141725:stack/myapp-StorageF7F305E7-GKBTUNLZOV60/0aa62010-0133-11e9-b872-1273bfab49fc was not successfully created: The following resource(s) failed to create: [DhcpOptions, EnsureEc2Vpc].
15:03:56 UTC+0200 CREATE_IN_PROGRESS AWS::CloudFormation::Stack StorageF7F305E7 Resource creation Initiated
15:03:53 UTC+0200 CREATE_IN_PROGRESS AWS::CloudFormation::Stack StorageF7F305E7
15:03:49 UTC+0200 CREATE_IN_PROGRESS AWS::CloudFormation::Stack myapp User Initiated
Seems to fail at storage. A bit new to aws (mostly google cloud till now), trying to figure it out 🙂
I'm using the latest datomic cloud. I'm trying to do the getting started tutorial (https://docs.datomic.com/cloud/getting-started/connecting.html). I have a connection to the bastion server running. When i run (d/create-database client {:db-name "movies"})
, i get ExceptionInfo Datomic Client Exception clojure.core/ex-info (core.clj:4739)
. Repl started with clj -A:dev
Fairly inexperienced with clojure, not sure how to debug further.
WHen to use dash in attribute names, and when to use dot or camel case? :dustingetz.gist/src-clojure :dustingetz.gist/src.clojure :db/valueType All camel case - weird!
https://clojure.org/reference/reader implies this is invalid
But not directly stated
Would overlap with class symbols
In code I control, I just 100% always use dots in the namespace portion, and kebab case in the keyword portion.
yeah, i adopted the same style as you. It could be that Datomic was designed to make java interop tolerable
Even JS interop is very camel case heavy...”the web” seems to favor it, so maybe that’s also part of it
Usually we use camel only when dealing with java interop
Datomic was originally designed to be Java friendly so that may be why, but just guessing
I have a tricky query that I'm struggling to express using my limited experience with datalog. I have a domain (video game) in which matches
reference many rosters
which reference many players
. I'm trying to formulate a query that would find all rosters containing ALL of the given players. In other words, find all rosters in which players [p1 p2 p3 ... pN]
all participated in together. Right now my query is:
:find ?r
:in $ [?name ...]
:where
[?p :player/name ?name]
[?r :roster/players ?p]
but this is pulling all rosters that contain any of the passed in players' names. How do I achieve the all semantics that I'm after?I am sorry to ask, how would you want the query to actually work? pull down player list for all rosters and find supersets of given player set? pull down roster list for each player and take set intersection of them all?
@tomjack no need to apologize, I'm still very new to datalog. I think maybe what you're suggesting is that I'm placing too large of an expectation on the query itself, and instead I should just pull down all rosters and then filter
on those that are supersets of names
?
well, depending on the sizes of various sets, different ways to implement this will perform better
if (say) you have a few players to search in your query, many more rosters, many more rosters than rosters containing all of the query players... then the second impl I suggested (intersection of roster set for query players) seems reasonable
and, you don't need to try to stuff everything in datalog like SQL, yes 🙂. so maybe :find ?p (distinct ?r)
and then clojure.set/intersection is a reasonable approach?
>it should be doable I'm very interested in an example of how it might be achieved completely inside of the query, purely as an excuse to expand my datalog vocab
Does it require the ability to bind a ?var
to an entire "unification set" (I'm not sure what to call this)? Right now ?p
above is only bound to one player at a time, but I think a query of this nature requires the ability to bind ?pset
, if that makes sense...
I mean worst case you can call q again inside the q (or use a custom query function) https://forum.datomic.com/t/subquery-examples/345
someone asked this kind of question before and I think got some answers, don't remember where...
>so maybe :find ?p (distinct ?r)
and then clojure.set/intersection is a reasonable approach?
@tomjack I think this is really close...but would indeed require two queries (not a big deal, but I'm still curious if datalog can express this idea in one)
you want like a 'pure datalog' solution? when you have custom db fns in query, you can express anything 🙂
also, it's not two queries. one query, then you do the intersection on the peer/client
Calvin, you want to call set logic from clojure.core inside the query, search the datomic forum
@cjsauer https://forum.datomic.com/t/exact-unordered-match-of-multi-valued-string-field/365/2
@dustingetz aha! Thank you for the link. It was this line that I was missing:
[(datomic.api/entity $ ?e) ?fat]
I was blanking on how any query function could be useful without being able to operate on the entity/set itself.yea, Datomic is pretty different, having access to all of clojure.core inside our queries is very sideways from what we are used to
its the clojure.core/= on a typed set
It certainly takes some getting used to, but having a language's core library available inside of queries is a super power...
Yeah you'll have to get the set in some other way
I mean this is begging to be an Ion, but you'll be able to make it work with datalog