This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-10
Channels
- # arachne (2)
- # beginners (5)
- # boot (6)
- # cider (3)
- # cljsrn (2)
- # clojure (34)
- # clojure-brasil (1)
- # clojure-poland (1)
- # clojure-spec (52)
- # clojure-sweden (1)
- # clojurescript (17)
- # datomic (14)
- # leiningen (3)
- # luminus (2)
- # om (85)
- # proton (89)
- # protorepl (1)
- # re-frame (1)
- # reagent (8)
- # ring-swagger (1)
- # spacemacs (2)
- # yada (6)
pretty sure this is going to be a "no", but - is there any way to use the log api with the rest api?
@lvh OK, I think I understand, correct me if I'm wrong. You want to store REST configuration in Datomic.
Basically, you'd like global defaults for the configuration, as well as resource-scoped / endpoint-scoped configuration to override it.
The way I would do it would be to have entities representing the global configuration, the resources and the endpoints, attributes for the options (e/g :rest.config/consumes
) and a to-one ref attribute representing configuration hierarchy (similar to Javascript's prototypal inheritance, e.g :rest.options/parent
).
I would then write something that generically climbs the inheritance chain to find the value for an option.
If you're querying from Datalog, you could use a recursive rule, e.g :
If you're querying from Clojure with Entities, I'd walk the inheritance chain manually, e.g :
(or you could use a transducer of course :))
@lvh does this answer your questions ?
@bhagany: I believe the log in query is supported via REST http://docs.datomic.com/log.html#log-in-query I'm not at a computer to test currently.
@marshall: Aha, it hadn't occurred to me to try inside query. I'll give it a shot. Thanks!
@marshall: hrm, on second thought, doing that appears to require passing the log as a data source to query. I don't see a way to do that via REST.
@val_waeselynck: I think so! Thanks!