mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
This commit is contained in:
parent
3a93650d9d
commit
2cb6e82330
6 changed files with 79 additions and 10 deletions
|
|
@ -31,6 +31,22 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func QueryEmbedBlocks() (ret []*Block) {
|
||||
stmt := "SELECT * FROM blocks WHERE type = 'query_embed' AND content = ''"
|
||||
rows, err := query(stmt)
|
||||
if nil != err {
|
||||
logging.LogErrorf("sql query [%s] failed: %s", stmt, err)
|
||||
return
|
||||
}
|
||||
defer rows.Close()
|
||||
for rows.Next() {
|
||||
if block := scanBlockRows(rows); nil != block {
|
||||
ret = append(ret, block)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func queryBlockHashes(rootID string) (ret map[string]string) {
|
||||
stmt := "SELECT id, hash FROM blocks WHERE root_id = ?"
|
||||
rows, err := query(stmt, rootID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue