MCPcopy Index your code
hub / github.com/ddev/ddev / GetDBClientCommand

Method GetDBClientCommand

pkg/ddevapp/ddevapp.go:837–845  ·  view source on GitHub ↗

GetDBClientCommand returns the appropriate database client command (mysql or mariadb) based on the database type and version.

()

Source from the content-addressed store, hash-verified

835// GetDBClientCommand returns the appropriate database client command (mysql or mariadb)
836// based on the database type and version.
837func (app *DdevApp) GetDBClientCommand() string {
838 // Use canonical mariadb client for MariaDB 10.5+
839 if app.Database.Type == nodeps.MariaDB {
840 if isNewMariaDB, _ := util.SemverValidate(">= 10.5", app.Database.Version); isNewMariaDB {
841 return "mariadb"
842 }
843 }
844 return "mysql"
845}
846
847// GetDBCompressionCommand returns the appropriate database compression command
848// based on the database type and version.

Callers 15

TestDdevMysqlWorksFunction · 0.95
TestDdevImportDBFunction · 0.95
TestDdevAllDatabasesFunction · 0.95
TestDdevExportDBFunction · 0.95
TestDdevExecFunction · 0.95
RestoreSnapshotMethod · 0.95
ImportDBMethod · 0.95
StartMethod · 0.95
XHGuiSetupFunction · 0.80
checkImportDBImportsFunction · 0.80

Calls 1

SemverValidateFunction · 0.92

Tested by 15

TestDdevMysqlWorksFunction · 0.76
TestDdevImportDBFunction · 0.76
TestDdevAllDatabasesFunction · 0.76
TestDdevExportDBFunction · 0.76
TestDdevExecFunction · 0.76
checkImportDBImportsFunction · 0.64
TestHostDBPortFunction · 0.64
TestLocalfilePullFunction · 0.64
TestAcquiaPushFunction · 0.64
TestPantheonPushFunction · 0.64