fix: remove unused db.sqlite related fns

- remove sqlite-db/close! as its not used and didn't make sense to be
  used in other electron ns
- remove sqlite-db/connections atom as its not needed
- remove read-graph as its not necessary
- rename cli.persist-graph as its primary purpose has changed
- update effected scripts
This commit is contained in:
Gabriel Horner
2023-12-13 11:59:21 -05:00
parent 79a9c59dd5
commit ffa6aaae29
16 changed files with 58 additions and 118 deletions

View File

@@ -7,7 +7,7 @@
[logseq.db.sqlite.util :as sqlite-util]
[logseq.db.sqlite.create-graph :as sqlite-create-graph]
[logseq.db.frontend.property.util :as db-property-util]
[logseq.outliner.cli.persist-graph :as persist-graph]
[logseq.outliner.cli.pipeline :as cli-pipeline]
[logseq.db :as ldb]
[clojure.string :as string]
[datascript.core :as d]
@@ -34,10 +34,9 @@
transacts initial data"
[dir db-name]
(fs/mkdirSync (node-path/join dir db-name) #js {:recursive true})
(sqlite-db/open-db! dir db-name)
;; Same order as frontend.db.conn/start!
(let [conn (ldb/start-conn :create-default-pages? false)]
(persist-graph/add-listener conn db-name)
(let [conn (sqlite-db/open-db! dir db-name)]
(cli-pipeline/add-listener conn)
(ldb/create-default-pages! conn {:db-graph? true})
(setup-init-data conn)
conn))

View File

@@ -23,8 +23,7 @@
(defn- publish-db-graph [static-dir graph-dir output-path]
(let [db-name (node-path/basename graph-dir)
_ (sqlite-db/open-db! (node-path/dirname graph-dir) db-name)
conn (sqlite-cli/read-graph db-name)
conn (sqlite-db/open-db! (node-path/dirname graph-dir) db-name)
repo-config (-> (d/q '[:find ?content
:where [?b :file/path "logseq/config.edn"] [?b :file/content ?content]]
@conn)