fix #23: delete didn't work anymore (#24)

This commit is contained in:
T.v.Dein
2025-02-17 13:46:59 +01:00
committed by GitHub
parent 44bb6a0a26
commit be13ec1111
2 changed files with 8 additions and 2 deletions

View File

@@ -386,8 +386,14 @@ func (db *DB) Del(attr *DbAttr) error {
defer db.Close()
err := db.DB.Update(func(tx *bolt.Tx) error {
bucket := tx.Bucket([]byte(db.Bucket))
// root bucket
root := tx.Bucket([]byte(db.Bucket))
if root == nil {
return nil
}
// get data sub bucket
bucket := root.Bucket([]byte("meta"))
if bucket == nil {
return nil
}

View File

@@ -26,7 +26,7 @@ import (
"github.com/tlinden/anydb/common"
)
var Version string = "v0.2.0"
var Version string = "v0.2.1"
type BucketConfig struct {
Encrypt bool