func (b *BadgerTreeDB) Update(callback func(TreeDatabaseTransaction) error) error {
	badgerTx := b.db.NewTransaction(true)

	err := callback(&BadgerTreeTransaction{badgerTx})
	if err != nil {
		badgerTx.Discard()
		return err
	}
	return badgerTx.Commit()
}
// Update updates the database.
Update updates the database.
// Update updates the database .
func (b *BadgerTreeDB) Update(callback func(TreeDatabaseTransaction) error) error {
	badgerTx := b.db.NewTransaction(true)
	err := callback(&BadgerTreeTransaction{badgerTx})
	if err != nil {
		badgerTx.Discard()
		return err
	}
	return badgerTx.Commit()
}
func ( b * BadgerTreeDB ) Update ( callback func ( TreeDatabaseTransaction ) error ) error { badgerTx := b . db . NewTransaction ( true ) err := callback ( & BadgerTreeTransaction { badgerTx } ) if err != nil { badgerTx . Discard ( ) return err } return badgerTx . Commit ( ) }
Update updates the database.
Update updates the database .