Skip to content

Commit

Permalink
:max-len -> :branching-factor
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Jul 27, 2023
1 parent 3ea726b commit e3c3489
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/datascript/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -766,4 +766,4 @@
(js/parseInt 16)
(* 1000))))

#?(:clj (load "storage"))
#?(:clj (load "core_storage"))
10 changes: 5 additions & 5 deletions src/datascript/serialize.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@
"aevt" aevt
"avet" avet
#?@(:clj
["max-len" (:max-len settings)
"ref-type" (name (:ref-type settings))]))))
["branching-factor" (:branching-factor settings)
"ref-type" (name (:ref-type settings))]))))

#?(:clj
(let [lock (Object.)]
Expand Down Expand Up @@ -225,9 +225,9 @@
aevt (some->> (dict-get from "aevt") (amap #(arrays/aget eavt %)) #?(:clj arrays/into-array))
avet (some->> (dict-get from "avet") (amap #(arrays/aget eavt %)) #?(:clj arrays/into-array))
settings (merge
{:max-len (dict-get from "max-len")
:ref-type (some-> (dict-get from "ref-type") keyword)}
(select-keys opts [:max-len :ref-type]))]
{:branching-factor (dict-get from "branching-factor")
:ref-type (some-> (dict-get from "ref-type") keyword)}
(select-keys opts [:branching-factor :ref-type]))]
(db/restore-db
{:schema schema
:eavt (set/from-sorted-array db/cmp-datoms-eavt eavt (arrays/alength eavt) settings)
Expand Down
2 changes: 1 addition & 1 deletion test_storage/datascript/test_storage.clj
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
(comment
(let [json (with-open [rdr (io/reader (io/file "/Users/tonsky/ws/roam/db_3M.json"))]
(json/parse-stream rdr))]
(def db (d/from-serializable json {:max-len 512}))
(def db (d/from-serializable json {:branching-factor 512}))
(count db))

(d/store streaming-edn-storage (d/empty-db))
Expand Down

0 comments on commit e3c3489

Please sign in to comment.