datalevin

vlad_poh 2024-09-21T21:42:10.579399Z

howdy y'all I tried using :keys to return maps from my query today and got the following error

datalevin.spill.SpillableSet cannot be cast to clojure.lang.IEditableCollection
here is a simple script to reproduce the error
#!/usr/bin/env bb
(require '[babashka.pods :as pods])
(pods/load-pod 'huahaiy/datalevin "0.9.3")
(ns dw2
  (:require
   [pod.huahaiy.datalevin :as d]))

(def schema {:x/id {:db/valueType :db.type/long
                    :db/unique    :db.unique/identity
                    :db/cardinality :db.cardinality/one
                    :db.install/_attribute :db.part/db}
             :x/sdate {:db/valueType :db.type/long
                       :db/cardinality :db.cardinality/one
                       :db.install/_attribute :db.part/db}
             :x/topic {:db/valueType :db.type/string
                       :db/cardinality :db.cardinality/one
                       :db.install/_attribute :db.part/db}})


(def conn (d/get-conn "dw2db" schema))
(def db (d/db conn))

(d/transact! conn [{:x/id 1 :x/sdate 20240904 :x/topic "Work and how to avoid it"}])
(d/transact! conn [{:x/id 2 :x/sdate 20240804 :x/topic "Can Kant count?"}])


(println (d/q '[:find ?e ?a
                :where [?e ?a]] db))


(println (d/q '[:find  ?v
                :keys x
                :where
                [?e :x/sdate ?d]
                [?e :x/topic ?v]
                [(> ?d 20240901)]]
              db))
this works if i change the datalevin version to 0.8.28 or earlier Was support for :keys dropped?

Huahai 2024-10-03T20:30:35.407339Z

Fixed

👍 1
1
Huahai 2024-09-22T15:11:04.649099Z

this is probably an oversight.

Huahai 2024-09-22T15:13:39.914689Z

https://github.com/juji-io/datalevin/issues/273

👍 1
🙏 1