mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve graph https://github.com/siyuan-note/siyuan/issues/13040
This commit is contained in:
parent
83b932478e
commit
a48609755e
4 changed files with 10 additions and 8 deletions
|
|
@ -428,7 +428,7 @@ func QueryRefsByDefIDRefID(defBlockID, refBlockID string) (ret []*Ref) {
|
|||
return
|
||||
}
|
||||
|
||||
func DefRefs(condition string) (ret []map[*Block]*Block) {
|
||||
func DefRefs(condition string, limit int) (ret []map[*Block]*Block) {
|
||||
ret = []map[*Block]*Block{}
|
||||
stmt := "SELECT ref.*, r.block_id || '@' || r.def_block_id AS rel FROM blocks AS ref, refs AS r WHERE ref.id = r.block_id"
|
||||
if "" != condition {
|
||||
|
|
@ -453,7 +453,7 @@ func DefRefs(condition string) (ret []map[*Block]*Block) {
|
|||
refs[rel] = &ref
|
||||
}
|
||||
|
||||
rows, err = query("SELECT def.* FROM blocks AS def, refs AS r WHERE def.id = r.def_block_id")
|
||||
rows, err = query("SELECT def.* FROM blocks AS def, refs AS r WHERE def.id = r.def_block_id LIMIT ?", limit)
|
||||
if err != nil {
|
||||
logging.LogErrorf("sql query failed: %s", err)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue