This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-11
Channels
- # adventofcode (8)
- # announcements (1)
- # arachne (23)
- # beginners (146)
- # boot (4)
- # calva (2)
- # cider (48)
- # cljs-dev (17)
- # clojure (214)
- # clojure-austin (2)
- # clojure-berlin (1)
- # clojure-europe (9)
- # clojure-italy (5)
- # clojure-nl (2)
- # clojure-sanfrancisco (2)
- # clojure-spec (124)
- # clojure-uk (67)
- # clojured (3)
- # clojurescript (95)
- # community-development (7)
- # cursive (68)
- # data-science (1)
- # datomic (80)
- # emacs (19)
- # figwheel (3)
- # figwheel-main (5)
- # fulcro (61)
- # javascript (2)
- # kaocha (1)
- # off-topic (25)
- # pathom (21)
- # pedestal (1)
- # perun (4)
- # reitit (11)
- # ring-swagger (2)
- # shadow-cljs (55)
- # spacemacs (4)
- # sql (8)
- # test-check (16)
- # tools-deps (2)
- # vim (13)
- # yada (4)
is it possible to query against an as-of
db within a datalog query; something like
(d/q '[:find ?e ?attr-name ?v ?tx ?user-id ?product-initial ?ingested-at
:in $ [[?e ?a ?v ?tx]]
:where
[?e :user/id ?user-id]
[(d/asof $ ?tx) ?e :historical/product-initials ?product-initial]
[?tx :db/txInstant ?ingested-at]
[?a :db/ident ?attr-name]]
datomic-db
previously-found-datom)
do I have to pass the historical db as a parameter to the datalog?
like
(d/q '[:find ?e ?attr-name ?v ?tx ?user-id ?product-initial ?ingested-at
:in $current $historic [[?e ?a ?v ?tx]]
:where
[$current ?e :user/id ?user-id]
[$historic ?e :historical/product-initials ?product-initial]
[$current ?tx :db/txInstant ?ingested-at]
[$current ?a :db/ident ?attr-name]]
datomic-db
(d/as-of datomic-db (:tx previously-found-datom))
previously-found-datom)
Q: I’m getting ready to add a circuit breaker into my Ions for http calls. I’m considering https://github.com/sunng87/diehard and https://github.com/Netflix/Hystrix/tree/master/hystrix-contrib/hystrix-clj. Anyone got any experience with this pattern in Ions yet?
Hystrix team seems to recommend https://github.com/resilience4j/resilience4j going forward.
that looks pretty interesting - do you know of any open source CLJ projects that use it, to see what the integration looks like? especially things like retrying..
does anyone know why the following would only seem to return the first 3-tuple rather than all of them across time (when run against (d/history db)
:
(def price-history-for-underlying
'[:find ?price ?time ?tx
:in $ ?sym
:where
[?und :underlying/symbol ?sym ?tx]
[?und :underlying/price ?price ?tx]
[?q :quote/underlying ?und ?tx]
[?q :quote/time ?time ?tx]])
do i need an aggregating function somewhere? (these two related entities are always inserted in the same call to transact
and thus should always have the same ?tx
across them).[not only are these inserted in the same call to transact
but the underlying
entity is actually nested under the quote
entity via it's underlying
attribute (both maps)].
[the one wrinkle is that there are many quotes with the same underlying value all transacted at once. but that should be fine as long as everything inside the collection of maps passed to transact
receives the same tx-id]
that's the red flag to me. generally it's really really hard to make tx time anything but a git-commit like audit history
time is just a piece of data. doesn't matter if it is skewed by a few hundred milliseconds. it is the time that the server quoted the price to me
i am more interested in knowing that the price in question was the price at the moment that the server reported it for
you can use :with
to include a binding for the purposes of computing the result set but do not want to include it in the result set
hmm, ok. with may be the answer here. including q only got me the fan-out at a particular moment in time. i am still not getting the fan-out across all moments in time
pretty sure. if that isn't true then much bigger problems are here. how can i verify it?
but if i'm not including the ?tx, how can i know how many ?tx's are accounted for in the result?
so, i got OutOfMemoryError on that query so i think it's safe to say that there are multiple entities
Hi, I'm sure you've got the question a thousand time before
but I am trying my hands with datomic
was trying to setup the dev storage
I put my key in the properties files
launch a transactor with .\bin\transactor .\config\dev-transactor.properties
I get back a message System started datomic:
Then I try to launch a peer-server like in the tutorial using in memory storage
Command is bin/run -m datomic.peer-server -h localhost -p 8998 -a myaccesskey,mysecret -d mydb,datomic:
The peer server can’t create databases in dev storage. you’ll need to connect a REPL and create the database first, then launch the peer server
And I get an error Exception in thread "main" java.lang.RuntimeException: Could not find mydb in catalog
So I guess I need to create a catalog called mydb
but how I am supposed to do?
I'm sorry I am very confused by the Datomic Architecture right now
@favila why is this only returning one transaction id?
core=>
(def price-history-for-underlying
'[:find ?tx
:with ?und
:in $ ?sym
:where
[?und :underlying/symbol ?sym ?tx]
; [?und :underlying/price ?price ?tx]
; [?q :quote/underlying ?und ?tx]
; [?q :quote/time ?time ?tx]
])
#'core/price-history-for-underlying
core=>
core=> (d/q price-history-for-underlying (d/history (db)) "OEX")
[[13194139534793]]
core=>
I was hoping to get all tx's in which that symbol is involved