preflight_checks
Generate SQL to run on the primary before a MySQL migration to detect long transactions, metadata locks, and replica lag that require waiting.
Instructions
SQL for the user (or DBA) to run on the primary right before deploying a migration: long transactions, long queries and metadata locks on the tables it touches, current table sizes, and how to check replica lag. Each query returns rows only when the deploy should wait. This tool does not connect to the database; hand the SQL to the user.
Args: sql: The migration that is about to run. mysql_version: Optional server version, e.g. "5.7.44"; picks SHOW SLAVE / REPLICA STATUS.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| mysql_version | No |