GetExistingDBType returns type/version like mariadb:10.11 or postgres:13 or "" if no existing volume This has to make a Docker container run so is fairly costly.
()
| 15 | // GetExistingDBType returns type/version like mariadb:10.11 or postgres:13 or "" if no existing volume |
| 16 | // This has to make a Docker container run so is fairly costly. |
| 17 | func (app *DdevApp) GetExistingDBType() (string, error) { |
| 18 | dbVersionInfo, err := app.getDBVersionFromVolume() |
| 19 | if err != nil { |
| 20 | return "", err |
| 21 | } |
| 22 | |
| 23 | if dbVersionInfo == "" { |
| 24 | return "", nil |
| 25 | } |
| 26 | |
| 27 | return GetDBTypeVersionFromString(dbVersionInfo), nil |
| 28 | } |
| 29 | |
| 30 | // getDBVersionFromVolume inspects the database volume to determine version info |
| 31 | // Returns the raw version string found in the volume, or empty string if none found |