datascript 2025-03-12

I would like to use datom literals in testing. But the reader throws. Here what I experience at the repl:

(let [conn   (ds/create-conn {})
      result (ds/transact! conn [{:name "Maksim"}])]
  (:tx-data result))
=> [#datascript/Datom [1 :name "Maksim" 536870913 true]]
Eval this in repl or test right hand side.
=> Syntax error (IllegalArgumentException) compiling fn* at (src/core.clj:0:0).
   No matching field found: idx for class datascript.db.Datom
Funnily this works:
(read-string "[#datascript/Datom [1 :name \"Maksim\" 536870913 true]]")
=> [#datascript/Datom [1 :name "Maksim" 536870913 true]]
Why can I read it with read-string but not with the repl reader?
*data-readers*
=> {datascript/Datom #'datascript.db/datom-from-reader,
    datascript/DB #'datascript.db/db-from-reader
    ...}

Wow! I didn't see that one coming! Thanx!!!!

I just ran into this as well