mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 Improve data indexing
This commit is contained in:
parent
7d8e928ce6
commit
444f873919
1 changed files with 8 additions and 0 deletions
|
|
@ -959,6 +959,10 @@ func deleteByBoxTx(tx *sql.Tx, box string) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func deleteBlocksByIDs(tx *sql.Tx, ids []string) (err error) {
|
func deleteBlocksByIDs(tx *sql.Tx, ids []string) (err error) {
|
||||||
|
if 1 > len(ids) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
var ftsIDs []string
|
var ftsIDs []string
|
||||||
for _, id := range ids {
|
for _, id := range ids {
|
||||||
removeBlockCache(id)
|
removeBlockCache(id)
|
||||||
|
|
@ -1136,6 +1140,10 @@ func deleteByRootID(tx *sql.Tx, rootID string, context map[string]interface{}) (
|
||||||
}
|
}
|
||||||
|
|
||||||
func batchDeleteByRootIDs(tx *sql.Tx, rootIDs []string, context map[string]interface{}) (err error) {
|
func batchDeleteByRootIDs(tx *sql.Tx, rootIDs []string, context map[string]interface{}) (err error) {
|
||||||
|
if 1 > len(rootIDs) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
ids := strings.Join(rootIDs, "','")
|
ids := strings.Join(rootIDs, "','")
|
||||||
ids = "('" + ids + "')"
|
ids = "('" + ids + "')"
|
||||||
stmt := "DELETE FROM blocks WHERE root_id IN " + ids
|
stmt := "DELETE FROM blocks WHERE root_id IN " + ids
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue