Skip to content

Add support for MariaDB#31

Open
jsongerber wants to merge 3 commits into
dcblogdev:mainfrom
jsongerber:main
Open

Add support for MariaDB#31
jsongerber wants to merge 3 commits into
dcblogdev:mainfrom
jsongerber:main

Conversation

@jsongerber
Copy link
Copy Markdown

This PR allows this package to work with MariaDB.
In MariaDB, --set-gtid-purged on mysqldump does not exist and throws an error.

Here is the changes I made:

  • Added REMOTE_DATABASE_TYPE config variable, with the default value to mysql, so there is no breaking change
  • If REMOTE_DATABASE_TYPE is set to mysql, --set-gtid-purged=OFF is used, otherwise it is not
  • If REMOTE_DATABASE_TYPE is set to mysql, mysqldump is used, otherwise mariadb-dump is used

There's some observation/question where you maybe can help:

  • The existing config variable REMOTE_DATABASE_MYSQL_HOSTNAME use mysql in its name, which could be confusing now that MariaDB is supported, not a big deal and changing it would be a breaking change. A solution could be to have a new REMOTE_DATABASE_HOSTNAME (without mysql) variable, and throw a deprecation notice when the old one is used.
  • REMOTE_DATABASE_TYPE is not strict, only mysql uses --set-gtid-purged=OFF, any other string is not using it. So using mariadb would have the same effect as foobar.
  • No error is shown if the dump fails, but that's probably out of this scope.
  • mysqldump is still available with MariaDB, but deprecated, mariadb-dump is replacing it.
  • I didn't add tests.

Closes #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MariaDB support

1 participant