chore: comment out electron? feature gate

feat/datascript-storage-test
Andelf 2023-11-30 02:29:08 +08:00
parent ca24545b53
commit f1d763aa12
4 changed files with 9 additions and 10 deletions

View File

@ -6,7 +6,6 @@
[cljs-bean.core :as bean]
[datascript.storage :refer [IStorage]]
[cognitect.transit :as t]
[cljs-bean.core :as bean]
[cljs.cache :as cache]
[datascript.core :as d]
[goog.object :as gobj]
@ -91,10 +90,10 @@
[repo addr]
(when addr
(when-let [db (get-db repo)]
(-> (query repo db
(str "select content from kvs where addr = " addr))
first
(gobj/get "content")))))
(-> (query repo db
(str "select content from kvs where addr = " addr))
first
(gobj/get "content")))))
(defn sqlite-storage
[repo {:keys [threshold]

View File

@ -124,10 +124,10 @@
data (persist-db/<fetch-init-data repo)
electron? (util/electron?)
{:keys [conn uuid->db-id-map journal-blocks datoms-count]}
(when-not electron? (sqlite-restore/restore-initial-data data {:conn-from-datoms-fn
(comment electron? (sqlite-restore/restore-initial-data data {:conn-from-datoms-fn
(fn profiled-d-conn [& args]
(util/profile :restore-graph-from-sqlite!-init-db (apply d/conn-from-datoms args)))}))
[conn datoms-count] (if electron?
[conn datoms-count] (if true
(do
(assert (some? data) "No data found when reloading db")
(let [datoms (dt/read-transit-str data)]
@ -143,7 +143,7 @@
;; TODO: Store schema in sqlite
;; (db-migrate/migrate attached-db)
(when-not electron?
(comment when-not electron?
(js/setTimeout
(fn []
(p/let [other-data (persist-db/<fetch-blocks-excluding repo (map :uuid journal-blocks))

View File

@ -139,7 +139,7 @@
(-> (p/let [^js sqlite (ensure-sqlite-init)
;; <fetch-initital-data is called when init/re-loading graph
;; the underlying DB should be opened
_ (.openDB sqlite repo)]
_ (.newDB sqlite repo)]
(.getInitialData sqlite repo))
(p/catch (fn [error]
(prn ::fuck-error)

View File

@ -15,7 +15,7 @@
(js/console.warn "TODO: list-db for electron is not implemented")
[])
(<unsafe-delete [_this _repo]
(js/console.warn "TODO: delete")
(js/console.warn "TODO: delete persidt-db on electron")
(p/resolved nil))
(<transact-data [_this repo tx-data tx-meta]
(p->c