chore: update docstrings in kv-entity

Also update other :import-type to be keywords like other values
This commit is contained in:
Gabriel Horner
2025-01-10 12:41:54 -05:00
parent 1adeaa3259
commit 25d1243edd
2 changed files with 14 additions and 13 deletions

View File

@@ -3,22 +3,22 @@
(:require [logseq.common.defkeywords :refer [defkeywords]]))
(defkeywords
:logseq.kv/db-type {:doc ":kv/value = \"db\" if it's a db-graph"}
:logseq.kv/graph-uuid {:doc "store graph-uuid if it's a rtc enabled graph"
:logseq.kv/db-type {:doc "Set to \"db\" if it's a db-graph"}
:logseq.kv/graph-uuid {:doc "Store graph-uuid if it's a rtc enabled graph"
:rtc {:rtc/ignore-entity-when-init-upload true
:rtc/ignore-entity-when-init-download true}}
:logseq.kv/import-type {:doc ":sqlite-db if import from sqlite.
FIXME: any other values?"}
:logseq.kv/imported-at {:doc "graph-import time"}
:logseq.kv/import-type {:doc "If graph is imported, identifies how a graph is imported including which UI or CLI import process. CLI scripts can set this to a custom value.
UI values include :file-graph and :sqlite-db and CLI values start with :cli e.g. :cli/default."}
:logseq.kv/imported-at {:doc "Time if graph is imported"}
:logseq.kv/graph-local-tx {:doc "local rtc tx-id"
:rtc {:rtc/ignore-entity-when-init-upload true
:rtc/ignore-entity-when-init-download true}}
:logseq.kv/schema-version {:doc "schema version"}
:logseq.kv/graph-created-at {:doc "graph create time"}
:logseq.kv/latest-code-lang {:doc "latest lang used by code-block"
:logseq.kv/schema-version {:doc "Graph's current schema version"}
:logseq.kv/graph-created-at {:doc "Graph's created at time"}
:logseq.kv/latest-code-lang {:doc "Latest lang used by a #Code-block"
:rtc {:rtc/ignore-entity-when-init-upload true
:rtc/ignore-entity-when-init-download true}}
:logseq.kv/graph-backup-folder {:doc "graph backup-folder"
:logseq.kv/graph-backup-folder {:doc "Backup folder for automated backup feature"
:rtc {:rtc/ignore-entity-when-init-upload true
:rtc/ignore-entity-when-init-download true}}
:logseq.kv/graph-initial-schema-version {:doc "schema-version when graph created"})
:logseq.kv/graph-initial-schema-version {:doc "Graph's schema version when created"})

View File

@@ -234,7 +234,7 @@
(p/do!
(persist-db/<import-db graph buffer)
(state/add-repo! {:url graph})
(repo-handler/restore-and-setup-repo! graph {:import-type "sqlite"})
(repo-handler/restore-and-setup-repo! graph {:import-type :sqlite-db})
(state/set-current-repo! graph)
(persist-db/<export-db graph {})
(db/transact! graph (sqlite-util/import-tx :sqlite-db))
@@ -298,9 +298,10 @@
(let [graph (str config/db-version-prefix bare-graph-name)
datoms (ldb/read-transit-str raw)]
(p/do!
(persist-db/<new graph {:import-type "debug-transit"
(persist-db/<new graph {:import-type :debug-transit
:datoms datoms})
(state/add-repo! {:url graph})
(repo-handler/restore-and-setup-repo! graph {:import-type "debug-transit"})
(repo-handler/restore-and-setup-repo! graph {:import-type :debug-transit})
(db/transact! graph (sqlite-util/import-tx :debug-transit))
(state/set-current-repo! graph)
(finished-ok-handler nil))))