inno schema

Extract schema and reconstruct DDL from tablespace metadata.

Usage

# Show DDL
inno schema -f users.ibd

# Verbose output with column/index breakdown
inno schema -f users.ibd -v

# JSON output
inno schema -f users.ibd --json

Options

OptionDescription
-f, --filePath to InnoDB data file
-v, --verboseShow structured schema breakdown above the DDL
--jsonOutput in JSON format
--page-sizeOverride page size
--keyringPath to MySQL keyring file

Behavior

For MySQL 8.0+ tablespaces with SDI metadata:

  • Parses the embedded data dictionary JSON
  • Extracts column definitions, indexes, and foreign keys
  • Reconstructs a complete CREATE TABLE DDL statement
  • Resolves column types, defaults, character sets, and collations

For pre-8.0 tablespaces without SDI:

  • Scans INDEX pages to infer basic index structure
  • Determines record format (compact vs. redundant)
  • Provides limited structural information