This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-26
Channels
- # aws (4)
- # beginners (21)
- # boot (12)
- # cider (3)
- # cljs-dev (1)
- # cljsrn (10)
- # clojure (190)
- # clojure-nl (1)
- # clojure-russia (7)
- # clojure-spec (1)
- # clojure-sweden (9)
- # clojure-uk (30)
- # clojurebridge (1)
- # clojurescript (105)
- # cursive (4)
- # emacs (8)
- # jobs (1)
- # jobs-rus (4)
- # klipse (1)
- # luminus (5)
- # om (3)
- # onyx (2)
- # pedestal (5)
- # powderkeg (15)
- # re-frame (13)
- # reagent (1)
- # ring-swagger (5)
- # rum (5)
- # vim (8)
@ddeaguiar - in you gist a few days back (https://gist.github.com/ddeaguiar/d93a81282b60a261a2afb53262a3aeeb), what exactly is returned by pull ?e [*]
?
In my case - where a single result is found, I'm seeing [[[{"db/id":17592186045428,"receipts.user/name":"David Goldfarb","...}]]]
, but [[]]
when there are no matches. It seems that the first case has an extra vector wrapped around it.
Another Vase question (unrelated to previous): It looks like, (judging by the example code, e.g. https://github.com/cognitect-labs/vase/blob/master/samples/petstore-full/resources/petstore-full-order.edn): :get
requests take unadorned keywords as parameters to a #vase/query
literal. But :post
queries need fully namespaced keywords to pass to a #vase/transact
. Is this asymmetry really there, or am I misunderstanding something. If so, why?
@deg There's a subtle reason for the difference, and it's reflected in the way those two different literals are formed. A query often uses parameters that come from the browser in a query string (e.g., for a GET, PUT, or DELETE.) These arrive from Pedestal as either :path-params
or :query-params
. Their names are URL-encoded by the browser and would be part of the request string in most cases. E.g., GET on /users/mtnygard would have a path that bind the last fragment to :id
. None of these have anything to do with the Datomic schema or it's attribute names.
OTOH, transactions are directly dealing with form data. The :properties
key on the transact literal is a whitelist of parameters from the form body that directly name Datomic attributes on the given entity. So they may be namespaced if you define your Datomic schema that way.
@mtnygard - That makes sense; or at least each half makes sense in isolation. But, it feels like the is forcing the creation of asymmetric APIs. I don't want to speculate about ways to fix it; I have some ideas, but anything I say will be naive and/or wrong at this stage, but it just has a funny smell to me. Are there any public samples of clients that interact with Vase servers? I'd feel more comfortable expressing an opinion once I see how this is used by folks who know what they are doing.