mirror of
https://github.com/logseq/logseq.git
synced 2026-04-29 08:26:40 +00:00
add export graph command
Also add properties :file option. Was useful to compare sqlite.build EDN w/ export equivalent
This commit is contained in:
@@ -61,6 +61,15 @@
|
||||
(count (:properties result)) " properties"))
|
||||
(notification/show! "Copied graphs's ontology data!" :success))))
|
||||
|
||||
(defn ^:export export-graph-data []
|
||||
(when-let [^Object worker @state/*db-worker]
|
||||
(p/let [result* (.export-edn worker (state/get-current-repo) (ldb/write-transit-str {:export-type :graph}))
|
||||
result (ldb/read-transit-str result*)
|
||||
pull-data (with-out-str (pprint/pprint result))]
|
||||
(.writeText js/navigator.clipboard pull-data)
|
||||
(println pull-data)
|
||||
(notification/show! "Copied graphs's data!" :success))))
|
||||
|
||||
(defn- import-submit [import-inputs _e]
|
||||
(let [export-map (try (edn/read-string (:import-data @import-inputs)) (catch :default _err ::invalid-import))
|
||||
import-block? (::sqlite-export/block export-map)
|
||||
|
||||
Reference in New Issue
Block a user