Forráskód Böngészése

add frontend.persist.db* to list of db namespaces

also cleaned up inconsistent alias and fixed export-db calling
db-based-graph? when caller fns already do this
Gabriel Horner 1 éve
szülő
commit
6f8badf18f

+ 1 - 0
.clj-kondo/config.edn

@@ -104,6 +104,7 @@
              frontend.modules.outliner.core outliner-core
              frontend.mobile.util mobile-util
              frontend.page page
+             frontend.persist-db persist-db
              frontend.schema.handler.common-config common-config-schema
              frontend.search search
              frontend.state state

+ 5 - 1
scripts/src/logseq/tasks/dev/db_and_file_graphs.clj

@@ -15,7 +15,8 @@
         ["logseq.db.sqlite." "logseq.db.frontend.property" "logseq.db.frontend.malli-schema"
          "electron.db"
          "frontend.handler.db-based."
-         "frontend.components.property" "frontend.components.class" "frontend.components.db-based"]))
+         "frontend.components.property" "frontend.components.class" "frontend.components.db-based"
+         "frontend.persist-db"]))
 
 (def file-graph-ns
   "Namespaces or parent namespaces _only_ for file graphs"
@@ -34,6 +35,9 @@
    "src/main/frontend/components/property.cljs"
    "src/main/frontend/components/property"
    "src/main/frontend/components/db_based"
+   ;; TODO: Enable this when run-export-periodically is deleted or moved out of the ns
+   #_"src/main/frontend/persist_db.cljs"
+   "src/main/frontend/persist_db"
    "src/electron/electron/db.cljs"])
 
 (def file-graph-paths

+ 2 - 2
src/main/electron/listener.cljs

@@ -22,7 +22,7 @@
             [logseq.graph-parser.util :as gp-util]
             [promesa.core :as p]
             [frontend.handler.property.util :as pu]
-            [frontend.persist-db :as persistent-db]))
+            [frontend.persist-db :as persist-db]))
 
 (defn- safe-api-call
   "Force the callback result to be nil, otherwise, ipc calls could lead to
@@ -39,7 +39,7 @@
                           (notification/show! error :error))]
       (if (config/db-based-graph? repo)
         (->
-         (p/let [_ (persistent-db/<export-db repo {})]
+         (p/let [_ (persist-db/<export-db repo {})]
            (ipc/ipc "persistent-dbs-saved"))
          (p/catch error-handler))
         ;; TODO: Move all file based graphs to use the above persist approach

+ 2 - 2
src/main/frontend/persist_db/browser.cljs

@@ -40,11 +40,11 @@
 (defn <export-db!
   [repo data]
   (cond
-    (and (util/electron?) (config/db-based-graph? repo))
+    (util/electron?)
     (ipc/ipc :db-export repo data)
 
     ;; TODO: browser nfs-supported? auto backup
-
+    
     ;;
     :else
     nil))