aitradeinc/php-sql-parser
A PHP SQL parser library for analyzing SQL strings. Parse queries into structured data (AST/array) you can inspect, validate, rewrite, or use for tooling like linters, query builders, or migration helpers. Lightweight package for PHP applications.
DB::listen) is still required.spatie/laravel-query-builder or Laravel’s native DB::enableQueryLog() for simpler needs.DB::listen or middleware, but no new Laravel integrations in this release.JOIN with subqueries).DB::listen to validate output.SqlParserFacade) to isolate the package and ease future swaps.$fillable) may still break parsing. Pre-process with toSql().LIMIT vs. FETCH).Model::saved) only after stability testing.mysql_* functions in legacy code).sqlparser-org/sqlparser).UNION ALL).EXECUTE in PostgreSQL).DROP TABLE).hiren/laravel-metrics to avoid bottlenecks.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Parsing accuracy issues | Silent query corruption | Fallback to raw SQL with explicit warnings. |
| PHP version incompatibility | Integration breaks | Use Docker/PHP polyfills (e.g., php-polyfill). |
| High parsing latency | API timeouts | Rate-limit parsing or use a queue. |
| Travis CI removal | Untested PHP/Laravel versions | Manual regression testing before upgrades. |
| Unmaintained package | Security vulnerabilities | Scan dependencies with roave/security-advisories. |
## SQL Parsing Change
- **Affected Query**: `UPDATE users SET ...`
- **Parser Rule**: Added `disallow_column_updates` check.
- **Manual Test**: Validated against PHP 8.0 + Laravel 9.
WITH clauses, vendor-specific syntax).How can I help you explore Laravel packages today?