MCPcopy
hub / github.com/rqlite/rqlite / VerifyDB

Method VerifyDB

snapshot/plan/executor.go:182–197  ·  view source on GitHub ↗

VerifyDB runs an integrity check on the database at the given path.

(path string)

Source from the content-addressed store, hash-verified

180
181// VerifyDB runs an integrity check on the database at the given path.
182func (e *Executor) VerifyDB(path string) error {
183 srcDB, err := db.Open(path, false, true)
184 if err != nil {
185 return err
186 }
187 defer srcDB.Close()
188
189 res, err := srcDB.VerifyIntegrity()
190 if err != nil {
191 return err
192 }
193 if !res.OK {
194 return fmt.Errorf("database failed verification: %s", res.Issues[0])
195 }
196 return nil
197}

Callers 1

TestExecutor_CheckDBFunction · 0.95

Calls 3

OpenFunction · 0.92
VerifyIntegrityMethod · 0.80
CloseMethod · 0.65

Tested by 1

TestExecutor_CheckDBFunction · 0.76