How to translate SQL to pt-online-schema-change CLI format?

Hi all,

I’m looking for an automate way to run pt-online-schema-change tool, and I don’t know if there is any tool, plugin, … that provides translation/conversion from SQL statements to pt-online-schema-change CLI format.
Before coding any script, I would prefer to know if there is something official from Percona.

Thanks in advance,

Hello @Victor_Munoz,
There is nothing official as it is a 1:1 mapping from ALTER to pt-osc. Example:

ALTER TABLE bar.foo ADD INDEX (column2);
pt-online-schema-change --alter "ADD INDEX (column2)" --database bar --table foo

Let us know what you come up with.

Sure, thanks Matthew