preview_sql_file
Preview a SQL file to see statement counts, type breakdown, and danger warnings without executing. Understand migration impact before running.
Instructions
Preview a SQL file without executing it. Shows statement count, types breakdown, and warnings for potentially dangerous operations (DROP, TRUNCATE, DELETE/UPDATE without WHERE). Similar to mutation_preview but for SQL files. Use this before execute_sql_file to understand what a migration will do.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Absolute or relative path to the .sql file to preview | |
| stripPatterns | No | Patterns to strip from SQL before parsing. E.g., ['/'] for Liquibase, ['GO'] for SQL Server. | |
| stripAsRegex | No | If true, stripPatterns are treated as regex patterns (default: false). | |
| maxStatements | No | Maximum number of statements to show in preview (default: 20, max: 100). |