package boltutil

import "github.com/moby/buildkit/util/db/boltutil"

Index

Functions

func Open

func Open(p string, mode fs.FileMode, options *bolt.Options) (db.DB, error)

func SafeOpen

func SafeOpen(dbPath string, mode os.FileMode, opts *bolt.Options) (db db.DB, err error)

SafeOpen opens a bolt database with automatic recovery from corruption. If the database file is corrupted, it backs up the corrupted file and creates a new empty database. This is useful for disposable databases like cache or history where data loss is acceptable but startup failure is not.

Source Files

db.go safe_open.go

Version
v0.28.0-rc2
Published
Feb 26, 2026
Platform
darwin/amd64
Imports
7 packages
Last checked
20 minutes ago

Tools for package owners.