GetDBDumpCommand returns the appropriate database dump command (mysqldump or mariadb-dump) based on the database type and version.
()
| 867 | // GetDBDumpCommand returns the appropriate database dump command (mysqldump or mariadb-dump) |
| 868 | // based on the database type and version. |
| 869 | func (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. |
| 880 | func (app *DdevApp) ImportDB(dumpFile string, extractPath string, progress bool, noDrop bool, targetDB string) error { |