KS DB Merge Tools logo KS DB Merge Tools
database diff & merge
KS DB Merge Tools for MySQL logo for MySQL
and MariaDB
KS DB Merge Tools for Oracle logo
MssqlMerge logo
KS DB Merge Tools for PostgreSQL logo
KS DB Merge Tools for SQLite logo
AccdbMerge logo
KS DB Merge Tools for Cross-DBMS logo
KS DB Merge Tools All-In-One license

Automation and Scripting

KS DB Merge Tools for MySQL can do a lot of database diff and merge tasks without user interaction. It has its own scripting language, designed to automate the most common tasks.

For example, you need to create a continuous integration (CI) nightly build that checks for schema changes between your Dev server database and Staging database. Such a report could be easily generated using KS DB Merge Tools for MySQL GUI: we just need to get schema changes summary (see Schema changes summary use case). Then using the toolbar we need to apply a 'New and Changed' filter and then do Export. But all these actions should be done by someone, that's not applicable for our task that should be done without user interaction.

Let's automate this task. Open Script Editor application:

for MySQL, click query result diff

As recommended in the sample script comments, 1 update database connection strings, script log and json report file paths. Script sample already contains required command to generate schema summary report, if you need some other actions - please check the documentation. Сlick 2 to check the script and make sure the Result panel has no errors. If so, click 3 to run the script and check its execution result. Select and copy text of your script, paste it into some text editor and save as file with *.ksdms extension. Now, assuming that you have KS DB Merge Tools for MySQL installed on CI server, you can create a task in your CI pipeline that would run the following command:

"c:\Program Files (x86)\KS DB Merge Tools for MySQL\MysqlMergeCmd.exe" "c:\temp\schemaDiff.ksdms"

where MysqlMergeCmd.exe argument should be a real path to your *.ksdms file.