pushery/sqlens-for-laravel
SQLens for Laravel gives you a clear lens on the SQL your application runs, helping you inspect, analyze, and debug queries during development. Lightweight and easy to drop into any Laravel project, it surfaces the database activity that matters so you can spot problems faster.
Architecture fit
ALTER TABLE, index builds, and backfills is a recurring source of Laravel deploy incidents, particularly on PostgreSQL (ACCESS EXCLUSIVE locks) and MySQL (online DDL caveats, metadata locks).undetermined up front.ALGORITHM=INSTANT/INPLACE behavior, and metadata locks do not map to PostgreSQL lock levels, and neither engine's behavior is fully knowable from SQL text alone. Expect engine-specific gaps.Integration feasibility
require-dev dependency with Artisan entry points; the integration surface is a CI job plus a config file, which is low-friction for a team already running Laravel in containers.--pretend (which is lossy for schema builder output and does not cover raw statements reliably), or parse the migration AST. Each choice has materially different CI cost, fidelity, and failure behavior. This is the first thing to validate in a spike.Technical risk
composer audit, full source review, and a fork vendored internally if the tool proves valuable.undetermined bucket will absorb cases the tool cannot decide, and if that bucket is treated as fail, the gate becomes brittle.DB::statement, DB::unprepared, third-party package migrations, trigger/function DDL, and data migrations are the highest-risk statements and the hardest to lint. Confirm coverage explicitly.undetermined becomes a rubber stamp.Key questions
--pretend, or static parsing? What is the fidelity for DB::statement and raw SQL?undetermined, and what exit code does it produce?schema:dump / squashed migrations, and with existing CI database service containers?Stack fit
require-dev dependency; no runtime footprint, no production container size impact, no framework bootstrapping changes.Migration path (sequencing)
database/migrations. Publish results as a PR comment or artifact. No gate. Duration: 2–4 weeks, chosen to accumulate a false-positive/false-negative sample against real team migrations.undetermined policy (recommended: warn, do not block, but require a reviewer acknowledgement on the PR).Compatibility and hygiene
php artisan schema:dump/squashed migrations, since squashed schemas change what "emitted SQL" means and may bypass per-migration analysis.Maintenance
undetermined results, review suppression requests, and re-tune thresholds when the tool's rules change or Laravel's schema builder changes its emitted SQL. Assign a named owner (platform/backend lead) before Phase 1; an unowned gate rots into a permanently ignored check.Support
Scaling
undetermined handling are codified; otherwise each team invents its own interpretation.Failure modes
ALTER TABLE. Mitigation: keep human review of data backfills and table rewrites in the definition of done; do not let the tool's pass status replace review.undetermined. Decide fail-open (warn) vs fail-closed (block) explicitly. Recommend fail-open with a visible warning for the first two quarters.Ramp-up
undetermined policy, build the suppression baseline, and write the runbook. The tool's interface is simple; the concepts — lock levels, online DDL, downtime risk classification — are the actual learning curve, and those are valuable knowledge regardless of whether the package is retained.How can I help you explore Laravel packages today?