chore: add basic tests for sqlite.build

and added a couple db-graph specific for query-dsl. Also
moved fns in pu that should be in db-pu
This commit is contained in:
Gabriel Horner
2024-06-10 11:51:47 -04:00
parent d574cc3b0e
commit 04b25a9240
9 changed files with 121 additions and 38 deletions

View File

@@ -4,8 +4,6 @@
compatible with file graphs"
(:require [frontend.state :as state]
[frontend.db.conn :as conn]
[frontend.db.utils :as db-utils]
[logseq.db.frontend.property :as db-property]
[logseq.db.frontend.property.util :as db-property-util]))
(defn lookup
@@ -14,18 +12,6 @@
(let [repo (state/get-current-repo)]
(db-property-util/lookup repo coll key)))
(defn properties-by-name
"Given a block from a query result, returns a map of its properties indexed by property names"
[repo block]
(->> (db-property/properties block)
(map (fn [[k v]]
[(:block/original-name (db-utils/entity k))
(or (some->> (:db/id v)
(db-utils/entity repo)
db-property/get-property-value-name)
v)]))
(into {})))
(defn get-block-property-value
"Get the value of a built-in block's property by its db-ident"
[block db-ident]
@@ -49,10 +35,4 @@
[block]
(let [repo (state/get-current-repo)
db (conn/get-db repo)]
(db-property-util/shape-block? repo db block)))
(defn get-closed-property-values
[property-id]
(let [repo (state/get-current-repo)
db (conn/get-db repo)]
(db-property/get-closed-property-values db property-id)))
(db-property-util/shape-block? repo db block)))