diff --git a/CHANGELOG.md b/CHANGELOG.md index eaf326598..593f92858 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## Unreleased + +* Updated `sql-export.sh` to use `mariadb-dump` command (if available). [#148](https://github.com/lando/core/pull/148) + ## v3.21.0-beta.18 - [April 29, 2024](https://github.com/lando/core/releases/tag/v3.21.0-beta.18) * Fixed bug that prevented password prompts from rendering diff --git a/scripts/sql-export.sh b/scripts/sql-export.sh index 1d05d7e11..c435e5c5e 100755 --- a/scripts/sql-export.sh +++ b/scripts/sql-export.sh @@ -61,9 +61,11 @@ while (( "$#" )); do esac done -# Get type-specific dump cpmmand +# Get type-specific dump command if [[ ${POSTGRES_DB} != '' ]]; then DUMPER="pg_dump postgresql://$USER@localhost:$PORT/$DATABASE" +elif [[ ${MARIADB_DATABASE} != '' && -x $(command -v mariadb-dump) ]]; then + DUMPER="mariadb-dump --opt --user=${USER} --host=${HOST} --port=${PORT} ${LANDO_EXTRA_DB_EXPORT_ARGS} ${DATABASE}" else DUMPER="mysqldump --opt --user=${USER} --host=${HOST} --port=${PORT} ${LANDO_EXTRA_DB_EXPORT_ARGS} ${DATABASE}" fi