MCPcopy Create free account
hub / github.com/ddev/ddev / GetDBDumpCommand

Method GetDBDumpCommand

pkg/ddevapp/ddevapp.go:869–877  ·  view source on GitHub ↗

GetDBDumpCommand returns the appropriate database dump command (mysqldump or mariadb-dump) based on the database type and version.

()

Source from the content-addressed store, hash-verified

867// GetDBDumpCommand returns the appropriate database dump command (mysqldump or mariadb-dump)
868// based on the database type and version.
869func (app *DdevApp) GetDBDumpCommand() string {
870 // Use canonical mariadb-dump for MariaDB 10.5+
871 if app.Database.Type == nodeps.MariaDB {
872 if isNewMariaDB, _ := util.SemverValidate(">= 10.5", app.Database.Version); isNewMariaDB {
873 return "mariadb-dump"
874 }
875 }
876 return "mysqldump"
877}
878
879// ImportDB takes a source sql dump and imports it to an active site's database container.
880func (app *DdevApp) ImportDB(dumpFile string, extractPath string, progress bool, noDrop bool, targetDB string) error {

Callers 2

ExportDBMethod · 0.95

Calls 1

SemverValidateFunction · 0.92

Tested by 1