This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-16
Channels
- # beginners (7)
- # boot (63)
- # capetown (1)
- # cider (20)
- # clara (15)
- # cljs-dev (5)
- # clojure (195)
- # clojure-austria (2)
- # clojure-dev (46)
- # clojure-dusseldorf (9)
- # clojure-germany (6)
- # clojure-greece (36)
- # clojure-italy (5)
- # clojure-nl (4)
- # clojure-russia (173)
- # clojure-sg (1)
- # clojure-spec (93)
- # clojure-uk (65)
- # clojure-ukraine (2)
- # clojured (9)
- # clojureremote (1)
- # clojurescript (52)
- # core-async (14)
- # core-logic (5)
- # cursive (21)
- # data-science (8)
- # datomic (60)
- # emacs (83)
- # jobs (9)
- # jobs-discuss (7)
- # juxt (6)
- # klipse (2)
- # leiningen (1)
- # lumo (24)
- # mount (4)
- # numerical-computing (1)
- # off-topic (18)
- # om (37)
- # om-next (5)
- # onyx (13)
- # pedestal (1)
- # perun (44)
- # proton (2)
- # rdf (3)
- # re-frame (24)
- # reagent (4)
- # remote-jobs (3)
- # spacemacs (3)
- # testing (6)
- # vim (10)
- # yada (2)
I know there is a feature request for "Google Cloud Datastore” support. I guess now when Spanner became public this changes things a bit on how one could run Datomic in the Google cloud. Anyone know if Spanner would work out of the box as a SQL backend? I admit to not thought enough about this, but I’m as I said a little curious.
I think spanner doesn't support INSERT statements
From what I've read on hacker news, may not be accurate
I am just wondering, given that :db/retract takes [:db/retract entity-id attribute value], what happens when I retract a value that is not the current value of the attribute on the entity?
Hi, i’m newbie to datomic - could you explain current state of planner & statistic in datomic?
@nicola Not sure, what exactly do you mean by "planner & statistic"?
i’ve seen “most selective clause” in docs - which means - i’m a planner as developer?
@nicola That is correct. Datomic datalog queries execute clauses in the order they are written. To ensure your query performs well, you should order the clauses so as to keep the "working set" of results as small as possible.
The datalog query engine has some optimizations built-in, such as range queries and predicates, but it does not attempt to analyze the distribution of your data.
this means if my data is not the same shape - some query runs will be fast and some extremely slow?
@nottmey working indeed for 0.9.5372
with the free version
@nicola It means that you are responsible for monitoring and optimizing the performance of your queries based on your data. Future releases of Datomic may be bundled with tools to assist in this analysis, but they are not part of the current release.
@stuartsierra ok, thanks
There are to edges of this problem - black magic of planners or manual optimisation - i hope clojurians will come up with something interesting in this area!
Yes, the query-order execution in Datomic's datalog engine is by design: query behavior is completely deterministic.
i.e. - now it’s isomorphic to execution plan, may be build next more declarative level abstraction on top of it
how can one extract pull pattern outside of query?
(d/q '[:find (pull ?tx [:db/txInstant]) (pull ?e
order-pattern)` where order-pattern is ie [*] ?
i have some more less hairy pull expressions that i would like to fold into one, and reuse, but it seems to escape me 😕
@karol.adamiec what do you want to achieve with this query? (I am having hard time to understand what it'd actually do)
i want to def a pull pattern like [*] outside of query
(d/q '[:find (pull ?e [*])
i want to be (d/q '[:find (pull ?e my-def)
well i need to tell it to pull stuf that is not a component
of course IRL the [*] pattern is more complicated 🙂
well that definitely escapes the quoting issue
hmm, no, that has not occured to me. in that case ?my-def is argument to query that must also be referenced in the :in clause right?
:db.error/invalid-pull Invalid pull expression (pull ?e ?pattern)
seems not to work
full q:
(d/q '[:find (pull ?tx [:db/txInstant]) (pull ?e ?pattern)
:in $ ?pattern
:where [?e :order/number _ ?tx]]
db
[*])
I'd like to hear from some one "official" pros/cons of pull within query, compared to (->> q pull-many (map/reduce))
i have none to offer, maybe my style of writing queries is a takeover from REST endpoint…. 🙂
you are still doing both on client, there is no shame in doing grouping outside the query - it'the same machine, and no extra round trips to "db" or leveraging external CPU power
on one hand yes, on other hand we move from declarative query into code territory 🙂
something like
(let [my-pp '[*]]
(->> db
(d/q '[:find [?i ?e]
:where [?e :order/number _ ?tx
?tx :db/txInstant ?i]])
(map (fn [[t id]]
[t (d/pull db my-pp id)]))))
i see how that would work, but still would like to make the unqouting work. the query is a ‘[], there must be a way to unroll a datastructure inside somehow using ~
you might not need to specify pp
in :in
then (can't test it now, don't have datomic nearby)
this might be useful for you too:
As people ponder experimenting with ahead-of-time planners, I'll remind you that:
'[:find ?desc
:in $ %
:where
[?root :num 100]
[descendant ?root ?desc]
[?desc :num 4]]
is just sugar for:
'{:find [?desc]
:in [$ %]
:where
[[?root :num 100]
[descendant ?root ?desc]
[?desc :num 4]]}
looks good, thx. had no luck with that today. I am missing some fundamental thing here…
http://docs.datomic.com/query.html#sec-4-2
Query
find-elem = (variable | pull-expr | aggregate)
pull-expr = ['pull' variable pattern]
pattern = (input-name | pattern-data-literal)
@dazld: forgot to mention another tutorial resource: http://www.learndatalogtoday.org/
Sweet. I haven't actually looked at it much, but I've heard people mention it and tutorials are pretty thin on the ground
We’re currently trying to stand up a Datomic transactor in the cn-north-1
AWS region. The DynamoDB endpoint for that region is
. I understand the transactor.properties
file allows for setting an override endpoint for things like ddb-local
. Doing that won’t allow me to set an aws-dynamodb-region
, and removing the region won’t let me use the ddb
protocol.
Are there any workarounds for this? ddb-local
used against real Dynamo causes the transactor to crash.
is it possible to get an entity's created time from an entity itself ( not from a query )? e.g. (:tx-time entity) or something like that?
@jdkealy I don't think it's possible using d/entity or d/pull