Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sqlens For Laravel Laravel Package

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.

Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • Correctly scoped as a build-time / CI-time tool, not a runtime dependency. It sits outside the request path, so it cannot affect production latency or availability — the most important architectural property for a package of this class.
  • Addresses a real gap in the Laravel toolchain. Pint, PHPStan/Larastan, and PHPUnit validate application code; nothing in the default Laravel stack validates the DDL actually emitted by migrations. Lock and downtime risk on 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).
  • The pass / fail / undetermined trichotomy is the right contract for a gate. It is honest about heuristic limits and maps cleanly onto CI exit codes, provided the team defines a policy for undetermined up front.
  • Dual-engine support (PostgreSQL + MySQL) matches the realistic Laravel production footprint, but it doubles the semantic surface: MySQL online-DDL algorithms, 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.
  • Complementary to, not overlapping with, existing migration review practice. It cannot replace a human review of data backfills or application-level rollout strategy.

Integration feasibility

  • Standard Composer install as a 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.
  • The critical unknown is the SQL-emission mechanism. To lint what migrations "actually emit," the tool must either run migrations against a disposable/shadow database, use --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.
  • Requires a live database service in CI (Docker service container or equivalent) for at least some modes. That is a real cost on CI minutes and a new source of flakiness, but it is standard practice for Laravel test suites and should be reusable infrastructure.
  • Live schema audit and drift detection require read access to production or staging catalog metadata. That is a privileged connection and needs security review before it is enabled anywhere near production.
  • Repository is listed as "unknown." This is the dominant feasibility blocker. Without a verifiable source repository there is no way to review the SQL parsing logic, inspect commit history, confirm the publisher identity behind "pushery," or assess the security posture of a component that will hold database credentials. No amount of feature fit compensates for an unverifiable supply chain. Treat as a hard gate before any non-sandbox use.
  • 11 stars is effectively zero community validation — no signal on edge-case handling, no ecosystem of issue reports to learn from.

Technical risk

  • Supply chain (high): unverifiable repository + low adoption + database credentials + production schema visibility is a high-trust combination. Mitigate with a pinned version, composer audit, full source review, and a fork vendored internally if the tool proves valuable.
  • False positives (high operational impact): a lint gate that blocks a release during an incident is worse than no gate. Heuristic SQL analysis will misclassify some statements; the undetermined bucket will absorb cases the tool cannot decide, and if that bucket is treated as fail, the gate becomes brittle.
  • False negatives (moderate, reputational): a green check creates asymmetric confidence. Teams will stop reasoning about locks because the tool said "pass."
  • Coverage gaps (moderate): raw 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.
  • Version coupling (moderate): Laravel's schema builder changes emitted SQL between major versions; a package that models emitted SQL must track those changes or drift silently.
  • Undetermined semantics (moderate): without a documented policy, undetermined becomes a rubber stamp.
  • Release metadata anomaly: the stated last release (2026-10-18) is inconsistent with a normal review timeline; verify the actual release history and whether it reflects a maintained cadence or a placeholder.

Key questions

  1. Where is the source repository, and can provenance and maintainer identity be independently verified?
  2. How is SQL captured — shadow database execution, --pretend, or static parsing? What is the fidelity for DB::statement and raw SQL?
  3. What is the supported matrix for Laravel, PHP, PostgreSQL, and MySQL versions, and what is the stated support policy?
  4. Does any mode require production credentials, and does the tool transmit schema metadata or telemetry off-host?
  5. How are false positives suppressed — inline annotations, baseline file, config allowlist? Is suppression auditable?
  6. What is the documented meaning of undetermined, and what exit code does it produce?
  7. Who maintains this, what is the release cadence, and is there any commercial backing or SLA available?
  8. What is the test coverage, and are there published fixtures for the risky-DDL cases the tool claims to catch?
  9. Does it compose with schema:dump / squashed migrations, and with existing CI database service containers?
  10. Does it model MySQL online-DDL algorithms and PostgreSQL lock levels separately, or does it apply one heuristic across both?

Integration Approach

Stack fit

  • Ideal target profile: Laravel 10+ on PHP 8.1+, PostgreSQL or MySQL in production, migrations executed as part of deploy (not a separate DBA-owned release process), and an existing PR-based CI pipeline (GitHub Actions, GitLab CI, Bitbucket Pipelines).
  • Poor fit where the database is managed by a separate DBA team with its own change-control process, where deploys are not migration-driven, or where migrations are largely raw SQL authored outside the app repo — in those cases the tool's coverage drops sharply right where risk is highest.
  • Installs as a require-dev dependency; no runtime footprint, no production container size impact, no framework bootstrapping changes.

Migration path (sequencing)

  1. Phase 0 — Verification spike (1–2 days, one engineer). Pin an exact version. Fork or mirror the source for review. Run in a throwaway branch against a scratch PostgreSQL and a scratch MySQL instance using a representative sample of your real migrations. Confirm the SQL-capture mechanism and inspect output quality on your own worst historical migrations. Exit criterion: verifiable source, acceptable output, no unexplained network calls. If the repository cannot be verified, stop here.
  2. Phase 1 — Report-only, non-blocking. Add a CI job that runs in observe mode on pull requests that touch 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.
  3. Phase 2 — Baseline and tune. Establish a suppression baseline for known, accepted risks in the existing schema. Set thresholds and document the undetermined policy (recommended: warn, do not block, but require a reviewer acknowledgement on the PR).
  4. Phase 3 — Blocking gate on migration diffs only. Enable failure only for newly added or modified migration files. Do not gate on the pre-existing schema — that produces an unactionable red build on day one and destroys trust in the tool.
  5. Phase 4 — Live schema audit and drift detection, staging first. Wire the audit against staging on a schedule. Confirm credential scoping is read-only and that no metadata leaves the environment. Compare audit output against expectations for one full release cycle before extending to production.
  6. Phase 5 — Pre-deploy guard in the release pipeline. Only after Phases 1–4 have produced a stable, low-noise signal. Requires a documented break-glass path so an on-call engineer can bypass the gate during an incident, with the bypass logged.

Compatibility and hygiene

  • Pin the Composer version exactly; treat upgrades as reviewed changes, not automatic dependency bumps.
  • Run the tool in a CI matrix across the Laravel and PHP versions you actually support, plus both database engines if you support both.
  • Verify interaction with php artisan schema:dump/squashed migrations, since squashed schemas change what "emitted SQL" means and may bypass per-migration analysis.
  • Keep the tool's database credentials scoped to a disposable CI database for linting, and a separate read-only credential for audit modes. Never share the migration credential with the audit job.
  • Budget CI cost explicitly: one additional database service container per PR job, plus scheduled audit runs.

Operational Impact

Maintenance

  • Low steady-state maintenance if it stays a dev dependency: no runtime patching, no version conflicts in production, no framework upgrade coupling beyond CI.
  • The real maintenance burden is ownership of the signal, not the code. Someone must triage 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.
  • Maintainer risk is the headline concern. A single, unverified publisher with 11 stars and an unverifiable repository means the package could be abandoned, renamed, or compromised with little warning. If the tool earns its place, plan to vendor a reviewed fork internally. That converts an external risk into a modest, bounded internal maintenance cost.

Support

  • Community-only support (GitHub issues, no SLA, no commercial backing evident). No escalation path for a blocked release.
  • Recommend the internal owner maintain a lightweight runbook: how to interpret each result class, how to suppress a false positive, how to bypass the gate in an incident, and who to escalate to.
  • Do not place this tool on the critical path of a release until the runbook exists and at least two engineers have exercised it.

Scaling

  • CI time scales with migration count and schema size; linting a full history on every PR will become slow. Scope the job to changed migrations where the tool supports it.
  • Parallel CI jobs require isolated database instances; shared shadow databases will cause cross-job interference and nondeterministic results — a direct threat to the "deterministic" claim.
  • Live schema audit cost scales with catalog size and is best run on a schedule rather than per-PR.
  • Organizationally, the tool scales poorly as a self-service gate unless suppression and undetermined handling are codified; otherwise each team invents its own interpretation.

Failure modes

  • False positive blocks a hotfix. Highest-severity operational failure. Mitigation: break-glass bypass, documented and logged; gate scoped to new migrations only.
  • False negative yields false confidence. A green check on a genuinely dangerous 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.
  • Database unavailable in CI → undetermined. Decide fail-open (warn) vs fail-closed (block) explicitly. Recommend fail-open with a visible warning for the first two quarters.
  • Credential or metadata exposure. Audit modes touch production catalogs. Enforce read-only roles, scope secrets to the job, and confirm no off-host transmission.
  • Version drift after a Laravel upgrade silently changes emitted SQL and therefore results. Add a re-baseline step to the framework-upgrade checklist.
  • Maintainer abandonment. Mitigated by the vendored-fork decision at Phase 2/3.

Ramp-up

  • Engineer time to wire up CI: roughly half a day to one day for someone familiar with the pipeline, assuming the SQL-capture spike succeeds.
  • Team time to productivity: one to two sprints to accumulate a real signal sample, agree the 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.
  • Overall: a low-cost, high-potential-value addition for a Laravel team with migration-driven deploys and a mature CI pipeline. The verdict hinges entirely on resolving the unverifiable repository and supply-chain question — that is a pass/fail gate, and everything else is tuning. Proceed to Phase 0 only; do not commit to blocking enforcement until Phase 0 and Phase 1 both clear.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console