mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
✨ 反链面板
This commit is contained in:
parent
8ae5858302
commit
f6411dba9a
4 changed files with 156 additions and 0 deletions
|
|
@ -343,6 +343,21 @@ func QueryRefsByDefID(defBlockID string, containChildren bool) (ret []*Ref) {
|
|||
return
|
||||
}
|
||||
|
||||
func QueryRefsByDefIDRefRootID(defBlockID, refRootBlockID string) (ret []*Ref) {
|
||||
stmt := "SELECT * FROM refs WHERE def_block_id = ? AND root_id = ?"
|
||||
rows, err := query(stmt, defBlockID, refRootBlockID)
|
||||
if nil != err {
|
||||
logging.LogErrorf("sql query failed: %s", err)
|
||||
return
|
||||
}
|
||||
defer rows.Close()
|
||||
for rows.Next() {
|
||||
ref := scanRefRows(rows)
|
||||
ret = append(ret, ref)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func QueryRefsByDefIDRefID(defBlockID, refBlockID string) (ret []*Ref) {
|
||||
stmt := "SELECT * FROM refs WHERE def_block_id = ? AND block_id = ?"
|
||||
rows, err := query(stmt, defBlockID, refBlockID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue