Skip to content

Commit

Permalink
Make lando db-export use mariadb-dump, if exists
Browse files Browse the repository at this point in the history
`mysqldump` is deprecated in current versions of MariaDB, and generates a
deprecation warning. This change allows `db-export` to use `mariadb-dump`
if that command exists and the `MARIADB_DATABASE` env var is set.

Resolves lando/mariadb#47
  • Loading branch information
christopher-b committed Apr 17, 2024
1 parent ecc823e commit 6528ccb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/sql-export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ done
# Get type-specific dump cpmmand
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
Expand Down

0 comments on commit 6528ccb

Please sign in to comment.