// UseDB allow Storm to use an existing open Bolt.DB. // Warning: storm.DB.Close() will close the bolt.DB instance. func UseDB(b *bolt.DB) func(*DB) error { return func(d *DB) error { d.Path = b.Path() d.Bolt = b return nil } }
// tearDownBoltDB closes and deletes boltdb func tearDownBoltDB(db *bolt.DB) error { p := db.Path() err := db.Close() if err != nil { return err } return os.Remove(p) }
// closedb closes and deletes a ReportifyDB database. func closedb(db *bolt.DB) { if db == nil { return } path := db.Path() db.Close() if path != "" { os.Remove(path) } }
func clean_bolt(db *bolt.DB) { db.Close() os.Remove(db.Path()) }