mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
This commit is contained in:
parent
bc7b29bd0e
commit
bd153b89c5
3 changed files with 18 additions and 11 deletions
|
|
@ -92,14 +92,10 @@ func docTitleImgAsset(root *ast.Node) *Asset {
|
|||
return nil
|
||||
}
|
||||
|
||||
func DeleteAssetsByHashes(hashes []string) {
|
||||
func deleteAssetsByHashes(tx *sql.Tx, hashes []string) (err error) {
|
||||
sqlStmt := "DELETE FROM assets WHERE hash IN ('" + strings.Join(hashes, "','") + "') OR hash = ''"
|
||||
tx, err := beginTx()
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
execStmtTx(tx, sqlStmt)
|
||||
commitTx(tx)
|
||||
err = execStmtTx(tx, sqlStmt)
|
||||
return
|
||||
}
|
||||
|
||||
func QueryAssetByHash(hash string) (ret *Asset) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue