Skip to content

Commit

Permalink
Bump PSS to 0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Dec 3, 2022
1 parent e8ba04f commit 8d560ad
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
4 changes: 2 additions & 2 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
:deps {
persistent-sorted-set/persistent-sorted-set {:mvn/version "0.1.4"}
persistent-sorted-set/persistent-sorted-set {:mvn/version "0.2.3"}
}

:aliases {
Expand Down Expand Up @@ -42,7 +42,7 @@

:nrepl {
:extra-deps {
nrepl/nrepl {:mvn/version "0.9.0"}
nrepl/nrepl {:mvn/version "1.0.0"}
lambdaisland/deep-diff2 {:mvn/version "2.0.108"}
}
}
Expand Down
4 changes: 2 additions & 2 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

:dependencies [
[org.clojure/clojure "1.10.2" :scope "provided"]
[org.clojure/clojurescript "1.10.520" :scope "provided"]
[persistent-sorted-set "0.1.4"]
[org.clojure/clojurescript "1.10.844" :scope "provided"]
[persistent-sorted-set "0.2.3"]
]

:plugins [
Expand Down
2 changes: 2 additions & 0 deletions script/nrepl.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash
set -o errexit -o nounset -o pipefail
cd "`dirname $0`/.."

clj -A:test:bench:datomic:nrepl -M -m nrepl.cmdline --interactive
13 changes: 13 additions & 0 deletions src/datascript/db.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,19 @@
:pull-attrs (lru/cache 100)
:hash (atom 0)}))))

(defn restore-db [{:keys [schema eavt aevt avet max-eid max-tx]}]
(map->DB
{:schema schema
:rschema (rschema (merge implicit-schema schema))
:eavt eavt
:aevt aevt
:avet avet
:max-eid max-eid
:max-tx max-tx
:pull-patterns (lru/cache 100)
:pull-attrs (lru/cache 100)
:hash (atom 0)}))

(defn- equiv-db-index [x y]
(loop [xs (seq x)
ys (seq y)]
Expand Down
18 changes: 7 additions & 11 deletions src/datascript/serialize.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,10 @@
#?(:clj arrays/into-array))
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))]
(db/map->DB
{:schema schema
:rschema (#'db/rschema (merge db/implicit-schema schema))
:eavt (set/from-sorted-array db/cmp-datoms-eavt eavt)
:aevt (set/from-sorted-array db/cmp-datoms-aevt aevt)
:avet (set/from-sorted-array db/cmp-datoms-avet avet)
:max-eid (dict-get from "max-eid")
:max-tx (dict-get from "max-tx")
:pull-patterns (lru/cache 100)
:pull-attrs (lru/cache 100)
:hash (atom 0)}))))
(db/restore-db
{:schema schema
:eavt (set/from-sorted-array db/cmp-datoms-eavt eavt)
:aevt (set/from-sorted-array db/cmp-datoms-aevt aevt)
:avet (set/from-sorted-array db/cmp-datoms-avet avet)
:max-eid (dict-get from "max-eid")
:max-tx (dict-get from "max-tx")}))))

0 comments on commit 8d560ad

Please sign in to comment.