This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-21
Channels
- # announcements (4)
- # beginners (47)
- # cider (7)
- # clj-kondo (9)
- # cljs-dev (16)
- # clojure (8)
- # clojure-dev (33)
- # clojure-europe (39)
- # clojure-germany (2)
- # clojure-my (1)
- # clojure-nl (1)
- # clojure-norway (18)
- # clojure-uk (6)
- # clojuredesign-podcast (8)
- # clojurescript (12)
- # cursive (9)
- # datomic (24)
- # docker (3)
- # fulcro (23)
- # hoplon (7)
- # hyperfiddle (2)
- # java (5)
- # jvm (3)
- # leiningen (9)
- # lsp (6)
- # off-topic (75)
- # pathom (17)
- # polylith (21)
- # reitit (1)
- # rewrite-clj (11)
- # scittle (2)
- # shadow-cljs (57)
- # uncomplicate (6)
- # yamlscript (27)
How can I query for an attribute where the value has been retracted? Is that what the built-in missing?
function is for? But I don’t think I can use that inside an or
clause.
I want to be able to pull entities that have had a new value asserted, or the last value retracted, after a certain point in time, after a specified t-basis. Just exploring I did this:
(d/q '[:find ?tt ?op
:in $
:where [?tt :my-attribute _ _ ?op]]
db)
But it only returns tuples with ?op
equal to true
. But I was hoping to get some false
’s in there, in cases where I know I’ve retracted :my-attribute
.And I don’t think missing?
is really what I want, because there are lots of entities that are missing this attribute. I specifically want entities where the attribute has been retracted: it used to exist, but now, or since a certain point in time, it doesn’t.
I have watched those videos before, but there is no way I can remember everything covered. Or know where in a particular video some tidbit might be mentioned. But searching for “retract” on the datomic docs site led me to history and that seems to be the ticket. I can combine a d/since
with a d/history
and it gives me all retractions and assertions since a particular point in time, which is exactly what I needed.
Glad you found what you were looking for! I wasn't suggesting to watch all 5 hours, sorry about that. I was just searching for the history section of the github repo
In the datomic docs the following is mentioned about DynamoDB, does the same principle apply for i.e. AuroraDB, Azure SQL and other SQL databases?
As a first rule of thumb, you should spend at least as much money on read+write capacity as you do on the transactor instance
No, that only applies to provisioned storages and is under the DDB heading where we need to provide guidance on capacity settings.
thanks @U1QJACBUM! Is there an equivalent rule of thumb for SQL storages?
I don't think so as DDB is unique in allowing you to independently specify read and write capacity. Perhaps there are SQL offerings out there that allow you to do this and any such offering I would start by applying said rule ^ The most common rub I see in SQL storage users (entirely unrelated to to read and write) is operational issues like not running datomic level gc and storage level maintenance (i.e. postgres vacuum) leading to a higer than expected cost of disk increasing. If your disk storage costs are high thats the first place I look.
Hi guys! I'm trying to use input vars to add dynamic behaviour to otherwise static queries. The idea is to attempt to unify an input with a ground value, and if that succeeds the query goes on, otherwise it breaks there. Here's the basic idea:
(d/q '[:find ?result
:in $ ?should-proceed?
:where
[(ground true) ?should-proceed?]
[(ground "result") ?result]]
db true) ;;=> #{["result"]}
Edit: not finished yet, sorry!
The problem is, if I set the input to false, I still get the result!
(d/q '[:find ?result
:in $ ?should-proceed?
:where
[(ground true) ?should-proceed?]
[(ground "result") ?result]]
db false) ;;=> #{["result"]}
If you, like I wonder, "what's the value of ?should-proceed?
", well:
(d/q '[:find ?result ?should-proceed?
:in $ ?should-proceed?
:where
[(ground true) ?should-proceed?]
[(ground "result") ?result]]
db false) ;;=> #{}
it's quantum, only collapses when looking at. Is this a bug?@U9RRPR0KE What version of Datomic are you using?
com.datomic/peer {:mvn/version "1.0.7021"}
What's the :sched
that's returned if you request https://docs.datomic.com/reference/query-stats.html#phases?
This is the first time I hear about :query-stats
, very interesting. This is what I get:
(([(ground $__in__2) ?should-proceed?] [(ground true) ?should-proceed?] [(ground "result") ?result]))
If you also look at :clauses
and compare each of the queries you posted, do you see any difference that might explain the return values you're seeing?
[{:clause [(ground $__in__2) ?should-proceed?], :rows-in 0, :rows-out 1, :binds-in (), :binds-out [?should-proceed?], :expansion 1} {:clause [(ground true) ?should-proceed?], :rows-in 1, :rows-out 0, :binds-in [?should-proceed?], :binds-out []} {:clause [(ground "result") ?result], :rows-in 0, :rows-out 1, :binds-in [], :binds-out [?result], :expansion 1}]
not sure what rows-in/out
is really about, but it appears the engine does understand should-proceed?
is a 'bind-in" in this context