Datomic Local 1.0.291 now available

The complete change log can be found at Change Log | Datomic Local

2025/03/19 - 1.0.291

  • Fix: ‘:db-name’ key is now available for Datomic Local DBs.
  • Fix: changes to BigDecimal attribute scale no longer ignored.

Are these problems documented somewhere, so I can understand what situations do they actually fix?

That might allow me to clean up some of our own workarounds.
Eg. we had to work around database IDs not consistently being UUIDs.
eg. a :storage-dir :mem db val’s :id is a UUID, but a :storage-dir "..." one’s is a string (the db name)

In-memory dbs still don’t return the actual :db-name, but some UUID instead, so I’m really not sure what is this fix about:

(ns datomic-repro-db-name
  "https://forum.datomic.com/t/datomic-local-1-0-291-now-available/2552"
  (:require [datomic.client.api :as d]))

(defn mk-db "Returns a db connection." [& [cfg-overrides]]
  (let [cfg (-> {:server-type :datomic-local
                 :system      "repro"
                 :db-name     "<db-name>"}
                (merge cfg-overrides))]
    (-> (d/client cfg)
        (doto (d/create-database cfg)) 
        (d/connect cfg)
        d/db)))

(comment
  (for [storage-dir [:mem
                     (-> "datomic-local-repro/"
                         (java.nio.file.Path/of (into-array String nil))
                         .toAbsolutePath str)]]
    ((juxt :id :db-name) (mk-db {:storage-dir storage-dir})))

=>
(["33283f96-cb0f-4b03-9b7f-f7ed7273048b" "33283f96-cb0f-4b03-9b7f-f7ed7273048b"]
 ["<db-name>" "<db-name>"])

  :-)

Hi Tom,

I am discussing the behavior of in-memory DBs with the dev team. But this change targeted durable Datomic Local DBs. The behavior prior to release 1.0.291:

(d/db conn)
=>
#datomic.core.db.Db{:id "anom178502", :basisT 5, :indexBasisT 0, :index-root-id nil, :asOfT nil, :sinceT nil, :raw nil}
(def db (d/db conn))
=> #'jaretbinford.localrepro/db
(get db :db-name)
=> nil

Release 1.0.291:

=> #'jaretbinford.localrepro/conn
(d/db conn)
=>
#datomic.core.db.Db{:id "anom178502", :basisT 5, :indexBasisT 0, :index-root-id nil, :asOfT nil, :sinceT nil, :raw nil}
(def db (d/db conn))
=> #'jaretbinford.localrepro/db
(get db :db-name)
=> "anom178502"
1 Like