alex-frolov/query-guard
Query Guard adds configurable safeguards to Laravel database queries, helping detect and block dangerous or unintended SQL before it reaches production. Enforce safety rules, catch destructive statements, and protect critical data with minimal setup.
flush(), Doctrine paginator tables, and DBAL savepoints, so a TPM should confirm whether Eloquent query-builder patterns are covered or only adjacent DBAL traffic.QUERY_GUARD_GENERATE_BASELINE=1, commit the baseline, and then fail builds on new findings. The package already supports baseline suppression and JSON reporting, which are the two mechanisms a TPM needs to introduce it without blocking all delivery on day one. ParaTest is supported, but the release notes clarify that parallel workers suppress console output and findings land only in report-json, so CI must parse the JSON artifact rather than scrape stdout.VALUES and the number of findings moves in both directions. Existing baselines will not match after upgrade: old entries can report as matching nothing, and tier 2 now checks tables inside subqueries, which can create new findings. Teams using fail-on="error" with tier 2 enabled should expect the first post-upgrade run to be noisy. There is also a false-negative risk on DBAL 3 without savepoints: query-in-loop cannot distinguish nested flushes under a test transaction, so a real flush() in a loop can be missed unless doctrine.dbal.use_savepoints: true is set. DBAL 4 is unaffected.report-json schema stable and documented? Can a TPM rely on it for dashboards and trend reporting?QUERY_GUARD_GENERATE_BASELINE=1, review the diff in findings, commit the new baseline, and only then re-enable CI enforcement. Teams on DBAL 3 should set doctrine.dbal.use_savepoints: true in test configuration before trusting query-in-loop results. Teams using ParaTest should update CI scripts to consume report-json rather than console output.fail-on="error" for new findings only, keeping the baseline as a ratchet. Turn on tier 2 separately and compare the first run against the tier 2-off baseline, because tier 2 both adds subquery coverage and changes how plan failures are counted. Finally, roll the pattern to additional services once the baseline workflow and JSON reporting are proven.query-in-loop change around Doctrine flush() and savepoints is particularly important: it turns a confusing false positive into either a correct finding or an explicit notice. The corrected README note about ParaTest output prevents a common CI-support trap. Remaining support burden is mostly developer education around baseline regeneration and interpreting tier 2 plan results.report-json rather than console logs. Tier 2 plan analysis may add cost on large suites because it inspects more plans and now checks subquery tables. A TPM should pilot on the largest representative suite and measure added CI time before making it a required gate across many repositories.query-in-loop, no-possible-index, and tier 2 findings mean, and on when to fix versus baseline. The v1.0.1 noise reduction lowers the ramp-up cost significantly: a tool that previously reported hundreds of low-value findings on a MySQL suite is much easier to introduce as a gate once those false positives are removed.How can I help you explore Laravel packages today?