fix: large graph creation having blank and incorrect block counts

large graph chunking assumed a certain tx order which isn't guaranteed.
There are also some edge cases where blocks could get separated from
each other which are now fixed. Also fixed a bug with validating user
properties and made small enhancement for query script
This commit is contained in:
Gabriel Horner
2024-04-23 09:25:07 -04:00
parent ee3ecdb464
commit 2f0fc3c18c
4 changed files with 29 additions and 18 deletions

View File

@@ -34,8 +34,10 @@
(update :block/properties (fn [props] (map (fn [m] (into {} m)) props)))))
(drop 2 args))
;; assumes no :in are in queries
(let [query (into (edn/read-string query*) [:in '$ '%])]
(mapv first (d/q query @conn (rules/extract-rules rules/db-query-dsl-rules)))))]
(let [query (into (edn/read-string query*) [:in '$ '%])
res (d/q query @conn (rules/extract-rules rules/db-query-dsl-rules))]
;; Remove nesting for most queries which just have one :find binding
(if (= 1 (count (first res))) (mapv first res) res)))]
(when ((set args) "-v") (println "DB contains" (count (d/datoms @conn :eavt)) "datoms"))
(prn results)))