Fork me on GitHub
#datomic
<
2018-12-16
>
claudiu13:12:04

hi 🙂 trying to get datomic cloud all set up but it keeps failing 😞 anybody else had problems with the CloudFormation setup ?

ro613:12:55

@claudiu No, do you have more specifics about the failure?

claudiu13:12:58

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

claudiu13:12:14

worked for US Est (ohio) will try again in other regions

claudiu13:12:01

Seems to fail at storage. A bit new to aws (mostly google cloud till now), trying to figure it out 🙂

timeyyy16:12:19

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.

Dustin Getz16:12:48

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!

Alex Miller (Clojure team)17:12:51

Never use dot in the name, only in namespace

❤️ 8
Alex Miller (Clojure team)17:12:24

But not directly stated

Alex Miller (Clojure team)17:12:51

Would overlap with class symbols

cjsauer16:12:10

☝️ I’ve wondered this myself...

cjsauer16:12:18

In code I control, I just 100% always use dots in the namespace portion, and kebab case in the keyword portion.

cjsauer17:12:13

Datomic’s schema keywords are one of the few anomalies to that rule...

Dustin Getz17:12:39

yeah, i adopted the same style as you. It could be that Datomic was designed to make java interop tolerable

cjsauer17:12:55

Ah that would make sense

cjsauer17:12:43

Even JS interop is very camel case heavy...”the web” seems to favor it, so maybe that’s also part of it

Alex Miller (Clojure team)17:12:18

Usually we use camel only when dealing with java interop

Alex Miller (Clojure team)17:12:56

Datomic was originally designed to be Java friendly so that may be why, but just guessing

cjsauer18:12:36

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?

tomjack18:12:41

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?

cjsauer19:12:08

@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?

tomjack19:12:57

well, depending on the sizes of various sets, different ways to implement this will perform better

tomjack19:12:45

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

tomjack19:12:41

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?

tomjack19:12:21

maybe if you are a client you might want to stuff it in, it should be doable too...

cjsauer19:12:22

>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

cjsauer19:12:35

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

cjsauer19:12:53

Something like (pseudo-code):

:where
[(into #{} ?p) ?pset]

tomjack19:12:53

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

tomjack19:12:26

someone asked this kind of question before and I think got some answers, don't remember where...

cjsauer19:12:00

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

tomjack19:12:53

you want like a 'pure datalog' solution? when you have custom db fns in query, you can express anything 🙂

tomjack19:12:26

also, it's not two queries. one query, then you do the intersection on the peer/client

Dustin Getz19:12:29

Calvin, you want to call set logic from clojure.core inside the query, search the datomic forum

cjsauer19:12:29

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

Dustin Getz19:12:18

yea, Datomic is pretty different, having access to all of clojure.core inside our queries is very sideways from what we are used to

Dustin Getz19:12:48

its the clojure.core/= on a typed set

cjsauer19:12:32

It certainly takes some getting used to, but having a language's core library available inside of queries is a super power...

cjsauer19:12:42

One question though, d/entity is not available in Cloud, correct?

Dustin Getz19:12:00

Yeah you'll have to get the set in some other way

cjsauer19:12:19

Is d/pull available for use inside the query?

Dustin Getz19:12:21

you can call clojure.core/set and d/pull

👍 4
Dustin Getz19:12:54

I mean this is begging to be an Ion, but you'll be able to make it work with datalog

cjsauer19:12:17

Awesome, thank you (and thank you @tomjack as well). Ions were going to be my go-to deployment strategy for this, so I'm glad to hear it 🙂