MCPcopy Index your code
hub / github.com/apache/answer / DumpAllData

Function DumpAllData

internal/cli/dump.go:32–46  ·  view source on GitHub ↗

DumpAllData dump all database data to sql

(dataConf *data.Database, dumpDataPath string)

Source from the content-addressed store, hash-verified

30
31// DumpAllData dump all database data to sql
32func DumpAllData(dataConf *data.Database, dumpDataPath string) error {
33 db, err := data.NewDB(false, dataConf)
34 if err != nil {
35 return err
36 }
37 defer func() {
38 _ = db.Close()
39 }()
40 if err = db.Ping(); err != nil {
41 return err
42 }
43
44 name := filepath.Join(dumpDataPath, fmt.Sprintf("answer_dump_data_%s.sql", time.Now().Format("2006-01-02")))
45 return db.DumpAllToFile(name, schemas.MYSQL)
46}

Callers 1

command.goFile · 0.92

Calls 3

NewDBFunction · 0.92
CloseMethod · 0.65
FormatMethod · 0.45

Tested by

no test coverage detected