hook up DB pipeline

This commit is contained in:
Junyi Du
2022-10-27 03:41:15 +08:00
committed by Tienson Qin
parent b760684847
commit 49336a96b7
5 changed files with 26 additions and 7 deletions

View File

@@ -51,6 +51,7 @@
(doseq [block blocks-to-add]
(.add indice (bean/->js block)))))
indice)))
(transact-pages! [_this _data] nil) ;; Page index is not available with fuse.js until sufficient performance benchmarking
(truncate-blocks! [_this]
(swap! indices assoc-in [repo :blocks] nil))
(remove-db! [_this]

View File

@@ -20,6 +20,12 @@
:page page
:content content})))
;; TODO Junyi: Finalize index code
(defn page->index
"Convert a page name to the index for searching (page content level)"
[page-name]
:no-op)
(defn build-blocks-indice
;; TODO: Remove repo effects fns further up the call stack. db fns need standardization on taking connection
#_:clj-kondo/ignore
@@ -29,12 +35,9 @@
(remove nil?)
(bean/->js)))
;; TODO Junyi: Finalize index code
(defn build-pages-indice
;; TODO: Remove repo effects fns further up the call stack. db fns need standardization on taking connection
#_:clj-kondo/ignore
(defn build-pages-indice
[repo]
(->> (db/get-all-page-contents)
(->> (db/get-all-pages repo)
(map page->index)
(remove nil?)
(bean/->js)))