mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
This commit is contained in:
parent
dc4b5accfb
commit
88f716b5d6
7 changed files with 90 additions and 48 deletions
|
|
@ -581,6 +581,21 @@ func GetBlock(id string) (ret *Block) {
|
|||
return
|
||||
}
|
||||
|
||||
func GetBlockRedundant(id string) (ret []*Block) {
|
||||
rows, err := query("SELECT * FROM blocks WHERE id = ?", id)
|
||||
if nil != err {
|
||||
logging.LogErrorf("sql query failed: %s", err)
|
||||
return
|
||||
}
|
||||
defer rows.Close()
|
||||
for rows.Next() {
|
||||
if block := scanBlockRows(rows); nil != block {
|
||||
ret = append(ret, block)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func GetAllRootBlocks() (ret []*Block) {
|
||||
stmt := "SELECT * FROM blocks WHERE type = 'd'"
|
||||
rows, err := query(stmt)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue