This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-12
Channels
- # adventofcode (42)
- # aleph (10)
- # announcements (1)
- # asami (138)
- # babashka (7)
- # beginners (7)
- # biff (13)
- # cider (7)
- # clj-kondo (15)
- # clojure (53)
- # clojure-austin (11)
- # clojure-belgium (2)
- # clojure-europe (23)
- # clojure-nl (1)
- # clojure-norway (55)
- # clojure-sweden (5)
- # clojure-uk (4)
- # cryogen (7)
- # cursive (63)
- # datomic (5)
- # eastwood (6)
- # emacs (31)
- # fulcro (7)
- # hyperfiddle (9)
- # introduce-yourself (3)
- # java (11)
- # lsp (10)
- # malli (14)
- # membrane (35)
- # off-topic (13)
- # portal (12)
- # prelude (1)
- # releases (2)
- # ring-swagger (27)
- # shadow-cljs (8)
- # timbre (25)
I believe I have a repro for incorrect behavior of the :default
option in a pull. When the attribute's value is false
, the default will override it:
(def client (d/client {:server-type :dev-local :system "dev"}))
; insert schema and entity
(let [_ (d/create-database client {:db-name "repro"})
con (d/connect client {:db-name "repro"})
schema [{:db/ident :account/name
:db/valueType :db.type/string
:db/unique :db.unique/identity
:db/cardinality :db.cardinality/one}
{:db/ident :account/active?
:db/valueType :db.type/boolean
:db/cardinality :db.cardinality/one}]
acct {:account/name "test"
:account/active? false}]
(d/transact con {:tx-data schema})
(d/transact con {:tx-data [acct]}))
; query without default
(let [con (d/connect client {:db-name "repro"})]
(d/pull (d/db con)
'[:account/name
:account/active?]
[:account/name "test"]))
; => :account{:name "test", :active? false}
; query with default
(let [con (d/connect client {:db-name "repro"})]
(d/pull (d/db con)
'[:account/name
[:account/active? :default true]]
[:account/name "test"]))
; => :account{:name "test", :active? true}
Thanks for the repro Tyler! I believe we actually have a fix for this already implemented and slated for our upcoming release.
Oh great!
Yeah the fix is in the next release which is currently being release tested and will hopefully be out this month.
FYI @U016TR1B18E the release is now out. 1.0.7075 has this fix for Pro. Cloud will be coming later this week. https://forum.datomic.com/t/datomic-1-0-7075-pro-now-available/2345
❤️ 1