This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-29
Channels
- # announcements (2)
- # babashka (2)
- # beginners (76)
- # boot (6)
- # calva (7)
- # cider (12)
- # clara (4)
- # clj-kondo (11)
- # cljdoc (9)
- # cljs-dev (21)
- # cljsrn (7)
- # clojure (72)
- # clojure-dev (158)
- # clojure-europe (2)
- # clojure-italy (3)
- # clojure-losangeles (3)
- # clojure-nl (5)
- # clojure-spec (29)
- # clojure-uk (93)
- # clojurescript (40)
- # cursive (7)
- # data-science (1)
- # datomic (28)
- # defnpodcast (5)
- # duct (5)
- # emacs (7)
- # events (2)
- # figwheel-main (5)
- # fulcro (55)
- # graalvm (2)
- # instaparse (1)
- # jobs (5)
- # juxt (1)
- # luminus (3)
- # nyc (2)
- # pathom (3)
- # planck (25)
- # re-frame (2)
- # reagent (4)
- # reitit (23)
- # shadow-cljs (381)
- # spacemacs (6)
- # sql (19)
- # tools-deps (7)
- # xtdb (4)
I want to upgrade from Solo -> Production, but my datomic database is currently serving a paid product. Is there a way to make this operation reversible in case it does not work as expected?
You can probably update the stack with the solo template to revert.
Has anyone encountered a problem where your whole system goes down when a code deploy is initiated by a Autoscaling group action
? This event is taking down our system which is then restored if we use another deployment.
I'm wondering why the #db/fn
reader macro doesn't work with code, only EDN.
#db/fn {:lang "clojure"
:params []
:code (inc 1)}
when evaluated gives
Can't embed object in code, maybe print-dup not defined:
clojure.lang.Delay@33ccca49
which IIUC means that it's trying to eval the delay, which I'm not sure why is happening.
The ❓ has been asked previously here, but w/out an answer: https://clojurians-log.clojureverse.org/datomic/2016-01-02/1451699503.001427because the compiler generates bytecode and doesn't know how to embed arbitrary objects (like the delay) in bytecode. if there is no special casing of how to embed some object in bytecode, the compiler falls back to calling pr, embedding the string, and then calling read-string when the bytecode is run
same thing
user=> (defmacro f [] (delay nil))
#'user/f
user=> (fn [] (f))
Syntax error compiling fn* at (REPL:1:1).
Can't embed object in code, maybe print-dup not defined: clojure.lang.Delay@205b132e
user=>
I’m not getting results binding :db.type/float
values, like (d/q '[:find ?e :where [?e :some/attr 1.0]] db)
, only for some values. I.e. I know that valid values are (1.0 2.0 3.5)
, and only 2.0
returns results in that query. What could I be missing?
I now see that the following query works:
(d/q '[:find (pull ?e [*])
:where
[?e :some/attr ?v]
[(> ?v 3.4)]
[(< ?v 3.6)]]
db)
So it seems like a floating point error issue for exact comparisons. I guess I should be using :db.type/bigdec
if I care about writing queries for exact values?Our Datomic Cloud Solo System is failing completely, the API times out with a 504. How can we go about debugging this in AWS?
Try to pinpoint where it goes wrong first and whether it’s a Datomic issue or an ApiGateway configuration. - What happens when you invoke the lambda directly instead of through apigw? - Can you connect to the database through the bastion? - Do the datomic CloudWatch logs have anything unusual?
CloudWatch logs don’t show anything, that is the unusual part, they start not reporting anything about datomic
I’m going to try 1-2 to replicate
if your datomic system cloudwatch logs just “stop” you should forcibly restart your compute instance
I'm trying to shovel some data from kafka into datomic cloud. Is there a ready made kafka connect sink for datomic cloud or should I write my own?
I'm wondering what the best way is to validate my data when working with Datomic Cloud. I have a sha-256 hash that I want to check if it is actually a valid sha-256 before inserting it. I have a function written. Should I do that check manually before inserting it or is there a way to have rules on certain attributes?
@brian.rogers https://docs.datomic.com/cloud/schema/schema-reference.html#attribute-predicates
@marshall I get a 'hash/sha-256?' is not allowed by datomic/ion-config.edn - {:cognitect.anomalies/category :cognitect.anomalies/forbidden, :cognitect.anomalies/message \"'hash/sha-256?' is not allowed by datomic/ion-config.edn\", :dbs [{:database-id \"<id>\", :t 24, :next-t 25, :history false}]}"}}
. Does this indicate that I need to push that function up as a transaction function?
@brian.rogers yes, “Attribute predicates must be on the classpath of a process that is performing a transaction.” - for Cloud that means they need to be ions
Is there a way to combine the results of these two queries in a single query? providing a default value for "status" when the join cannot be made? I've been missing with get-else
but I don't think it's exactly what I need here
;;find placed orders requests that have not been acknowledged with a
;;received status message
(d/q
'[:find ?oid
:where
[?e :iboga.req.place-order/order-id ?oid]
(not [?status-msg :iboga.recv.order-status/order-id ?oid])]
(d/db DB))
;;find placed orders requests that have been acknowledged with a
;;received status message and join with status
(d/q
'[:find ?oid ?status
:where
[?e :iboga.req.place-order/order-id ?oid]
[?status-msg :iboga.recv.order-status/order-id ?oid]
[?status-msg :iboga.recv.order-status/status ?status]]
(d/db DB))
Something like this might work:
(d/q
'[:find ?oid ?status
:where
[?e :iboga.req.place-order/order-id ?oid]
(or-join [?oid ?status]
(and [?status-msg :iboga.recv.order-status/order-id ?oid]
[?status-msg :iboga.recv.order-status/status ?status])
(and (not [?status-msg :iboga.recv.order-status/order-id ?oid])
[(ground :none) ?status]))]
(d/db DB))
But I wonder why your status message entity cannot point directly to the order entity. Why do you have to do this "join" on the order id value.This (not [?status-msg :iboga.recv.order-status/order-id ?oid])
, in particular, might be inefficient.
That works, thanks! So you mean just having the order-id be a :db/unique
attribute so all the attributes above point to the same entity, then just doing get-else
for the status?