This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-21
Channels
- # announcements (6)
- # bangalore-clj (1)
- # beginners (46)
- # cider (21)
- # cljs-dev (30)
- # cljsjs (3)
- # clojure (131)
- # clojure-dev (20)
- # clojure-europe (2)
- # clojure-italy (12)
- # clojure-nl (11)
- # clojure-russia (4)
- # clojure-spec (55)
- # clojure-uk (57)
- # clojurebridge (1)
- # clojured (1)
- # clojurescript (55)
- # cursive (11)
- # data-science (1)
- # datomic (23)
- # duct (1)
- # emacs (1)
- # events (1)
- # figwheel-main (2)
- # fulcro (219)
- # graphql (16)
- # immutant (1)
- # jackdaw (3)
- # java (6)
- # juxt (30)
- # kaocha (8)
- # mount (3)
- # nyc (1)
- # off-topic (16)
- # pathom (48)
- # pedestal (1)
- # re-frame (71)
- # reagent (17)
- # ring-swagger (3)
- # shadow-cljs (96)
- # spacemacs (21)
- # specter (8)
- # speculative (20)
- # sql (21)
- # test-check (2)
- # tools-deps (12)
- # vim (6)
it's possible to have a type system which assigns one type to each entity, but allows you to use different namespaces for the attributes. that doesn't restrict power and allows you to know that a user is a user, and have a user spec etc
can someone help me with dates in queries? in this example i'm looking for entities that have transactions made to their :item/available attribute before some date (now). *edit:
(d/q '{:find [?e]
:in [$]
:where [
[?e :item/available? _ ?t]
[?t :db/txInstant ?inst]
[(< ?inst (java.util.Date.))]
]}
db)
=> ExceptionInfo processing clause: [?t :db/txInstant ?inst], message: java.lang.ClassCastException clojure.core/ex-info (core.clj:4739)
and flipping <
to >
runs successfully with no results, which makes sense because nothing has been transacted in the future. => []
I thought the ClassCastException was on the <
clause, expecting a Number instead of a Date, but apparently this is somewhere else: processing clause: [?t :db/txInstant ?inst], message: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to java.util.Date
and you're right, it return an empty set with >
. Very surprising behavior.
@marshall I know the query was malformed in the first place but shouldn't the error indicate a problem with using <
on a Date? Does the ClassCastException on PersistentList makes sense to you?
you can do comparison on dates in Datomic datalog clauses. You want to pass a date as a parameter into the :in
portion of the query, not instantiate one in-line with the java.utile.Date
constructor.
@bkamphaus Good catch. That's likely why I didn't remember this behavior.
This is a little surprising that the 2 queries don't have the same behavior whether you pass the date or inline it. I would like one day to understand why that is.
I’d guess that the way it errors is considered undefined behavior b/c it’s not valid Datomic datalog. A fn-expression
can be an expression-clause
which can be a where-clause
but you can’t nest functions this way. A fn expression itself is only valid as [[fn fn-arg+] binding]
I have a datomic ions related question. Is there a way to include sources and dependencies from extra-paths
and extra-deps
defined within an alias
in deps.edn
while creating a new ions revision? I’ve tried to run push command with including my alias but it didn’t help: clojure -A:dev:my-alias -m datomic.ion.dev '{:op :push}'
. I’ve checked the contents of the resulting revision zip file and it didn’t contain the sources defined in extra-paths
.
I’ve seen a similar post in datomic forum https://forum.datomic.com/t/tools-deps-aliases-in-ion-deployments/667. Is there anyone who can help about this?
Aha! I thought it would work pretty straightforward, and I was wrong 🙂. Hope someone has answers for us!
I’ve seen a similar post in datomic forum https://forum.datomic.com/t/tools-deps-aliases-in-ion-deployments/667. Is there anyone who can help about this?