datahike

https://datahike.io/, Join the conversation at https://discord.com/invite/kEBzMvb, history for this channel is available at https://clojurians.zulipchat.com/#narrow/stream/180378-slack-archive/topic/datahike
2020-06-25T06:20:09.431100Z

Please forgive me if I'm misunderstanding, but this doesn't seem quite right. It's perfectly possible to use persistent storage from clojure without explicitly using atoms.

sova-soars-the-sora 2020-06-25T14:43:31.433100Z

datahike.db/explode/iter/fn                  db.cljc: 1198
                         datahike.db/validate-attr                  db.cljc:  984
clojure.lang.ExceptionInfo: Bad entity attribute :db/retract at #:db{:id 149, :retract [:message/content "f78a3ec0-6c97"]}, not defined in current schema
    attribute: :db/retract
      context: #:db{:id 149, :retract [:message/content "f78a3ec0-6c97"]}
        error: :transact/schema
how can I commence a retract? I am looking at this to no avail: https://github.com/replikativ/datahike/search?q=retract&unscoped_q=retract

sova-soars-the-sora 2020-06-25T14:48:56.433600Z

Ah, you can retract a lot of tuples like :db/retract [pairs-of-tuples-here] i think... testing it out now 🙂

sova-soars-the-sora 2020-06-25T14:51:51.434200Z

(defn commence-remove-upvote 
  "removes an upvote with retract transaction" 
    [messageid authorid] 
			 (d/transact conn [ {:db/retract [:message/content   messageid]
								         :message/authorid authorid
									     :message/kind      "upvote"}]))

sova-soars-the-sora 2020-06-25T14:56:11.434500Z

;_; no dice

sova-soars-the-sora 2020-06-25T14:56:26.434800Z

clojure.lang.ExceptionInfo: Bad entity attribute :db/retract at #:db{:id 154, :retract [:message/content "6b45b69c-11d5" :message/authorid "<mailto:jack@satisologie.com|jack@satisologie.com>" :message/kind "upvote"]}, not defined in current schema

sova-soars-the-sora 2020-06-25T15:05:02.435400Z

almost there.. {} was not right, [] was the answer... hopefully a unique dbRef will be all i need now

👍 1