This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-11
Channels
- # asami (19)
- # babashka (41)
- # beginners (115)
- # biff (7)
- # calva (78)
- # clj-kondo (29)
- # cljs-dev (9)
- # clojure (39)
- # clojure-europe (17)
- # clojure-gamedev (29)
- # clojure-nl (1)
- # clojure-norway (9)
- # clojure-spec (2)
- # clojure-uk (3)
- # clojurescript (7)
- # core-async (26)
- # cursive (16)
- # datomic (13)
- # emacs (1)
- # events (5)
- # fulcro (2)
- # funcool (4)
- # gratitude (1)
- # helix (1)
- # holy-lambda (1)
- # humbleui (1)
- # introduce-yourself (4)
- # java (1)
- # jobs (2)
- # jobs-discuss (9)
- # lsp (28)
- # matcher-combinators (2)
- # mathematics (1)
- # membrane (1)
- # nbb (12)
- # off-topic (10)
- # pathom (52)
- # polylith (38)
- # portal (32)
- # re-frame (4)
- # reagent (16)
- # reitit (2)
- # remote-jobs (1)
- # reveal (1)
- # rewrite-clj (10)
- # sci (67)
- # shadow-cljs (45)
- # squint (1)
- # tools-build (13)
- # tools-deps (16)
Anyone ever get datomic ions/`ion-dev` working from windows?
Currently getting this when trying to clojure -A:ion-dev '{:op :push}'
:
{:command-failed "{:op :push}",
:causes
({:message "Unable to transform path",
:class ExceptionInfo,
:data
{:home "C:\\Users\\me",
:prefix "C:\\Users\\me/.m2/repository", ;; mixing the slashes might be the issue?
:resolved-coord
{:mvn/version "1.0.362",
:deps/manifest :mvn,
:paths
["C:\\Users\\me\\.m2\\repository\\com\\cognitect\\transit-java\\1.0.362\\transit-java-1.0.362.jar"],
:dependents [com.cognitect/transit-clj]}}})}
If I plan to store dates (YYYY-mm-dd) in datomic and query against them often (using < and >), is it better to store them as serialized strings or as instants with the time component set to something like midnight?
Datomic can compare j.u.Date objects natively. I dont think thats the case for strings
sadly Datomic doesnt support java.time.LocalDate just yet
:in $ ?reference-date
:where
[?e :my/date ?date]
[(< ?date ?reference-date)]
I know from experience queries like this work for j.u.Dates :db.type/instant, but you think that won't work for :db.type/string?You can just try, and apparently I was wrong:
(d/q '{:find [?e]
:where [[?e :valid/from ?a]
[?e :valid/to ?b]
[(< ?a ?b)]]}
[[1 :valid/from "2020-01-01"]
[1 :valid/to "2022-01-01"]])
=> #{[1]}
(this vector-of-tuples-datasource only works in peer)
Hm ok, that is good to know, thanks! Back to my original question.. is there a significant perf difference between the two?
I wouldn’t store them as juD with zeroed out time part just because it’s so easy for them to pick up extra precision and drift. You could use an attribute predicate to make sure it stays zero
You can also store dates as epoch days.