iamcal/sql-parser
Fast PHP parser for MySQL 5.7 CREATE TABLE statements. Converts schema SQL into an easy-to-use array describing tables, fields, indexes, and options. Designed to deconstruct valid DDL (not validate it); install via Composer.
Architecture fit: Strong for PHP-based systems requiring MySQL schema introspection (specifically CREATE TABLE parsing), fitting seamlessly into Laravel's ecosystem via Composer. However, strictly limited to MySQL 5.7 syntax and schema definition analysis only—no support for ALTER, DDL workflows, or multi-database scenarios. Ideal for targeted use cases like schema diffing but insufficient for full database lifecycle management.
Integration feasibility: High for Composer-based PHP projects with minimal boilerplate (1-line install, simple API). Direct compatibility with Laravel's tooling (Artisan commands, console jobs) but requires strict adherence to MySQL 5.7 syntax. No support for Laravel's migration DSL (e.g., Schema::table), necessitating raw SQL input for parsing.
Technical risk: Low-moderate due to proven performance (140ms for 88K SQL) but high dependency on unsupported features. Critical risks include silent failures for MySQL 8.0+ syntax (e.g., invisible columns), partitions, or FLOAT(bits), and zero community dependents indicating minimal active maintenance. Throw-on-bad-syntax mode must be enforced to avoid silent truncation.
Key questions: How will unsupported MySQL 8.0 features be handled in production? What is the process for contributing fixes given minimal recent activity? Are there known edge cases in production-scale SQL dumps that cause parsing errors? How does this integrate with Laravel's existing schema validation tools?
Stack fit: Optimal for Laravel projects using MySQL 5.7 where lightweight schema introspection is needed (e.g., CI schema validation, migration scripting). Does not replace Laravel's migration system but complements it by parsing raw SQL dumps for cross-environment comparisons. Incompatible with PostgreSQL, SQL Server, or MySQL 8.0+.
Migration path: 1) Install via Composer; 2) Wrap parser in a Laravel service provider or Artisan command;
How can I help you explore Laravel packages today?