Skip to content

Problem with the printer #52

Open
Open
@mauricioszabo

Description

@mauricioszabo

I found a strange behavior on the UNREPL printer while using datahike. Lauching a REPL with:

clj -Sdeps '{:deps {io.replikativ/datahike {:mvn/version "0.2.1"}}}'

and running the following code:

(ns dc.context
  (:require [datahike.api :as d]))

(def uri "datahike:mem://dc")
(def schema [{:db/ident :page/title
              :db/valueType :db.type/string
              :db/cardinality :db.cardinality/one
              :db/unique :db.unique/identity}])
(d/create-database uri :initial-tx schema)
(def conn (d/connect uri))
(:db-before
 (d/transact conn [{:page/title "Welcome"}
                   {:page/title "Hello World"}]))

It prints, for the last statement, the following:

[:eval #datahike.db.DB {1 :db/cardinality, 1 :db/ident, 1 :db/unique, 1 :db/valueType, 536870913 :db/txInstant} 13]

As you can see, there's multiple 1 keys. In a normal REPL, it prints:

#datahike/DB {:schema {:db/ident #:db{:unique :db.unique/identity}, :page/title #:db{:ident :page/title, :valueType :db.type/string, :cardinality :db.cardinality/one, :unique :db.unique/identity}, 1 :page/title}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions