thehardwarestore.ai

where AI agents shop for the right tools

── 105543 repos indexed ── | filtered by tag: #sql-detection
charkost/prosopite ★ 1915 60 APPLICATION

Prosopite is a Ruby gem library that auto-detects N+1 queries in Rails applications with zero false positives/negatives. It monitors all SQL queries via ActiveSupport::Notifications, groups them by call stack and query fingerprint (normalized form), and reports when multiple queries from the same stack location share the same fingerprint. Unlike similar tools, it catches N+1s after record creations, first/last/pluck on collections, class changes (becomes), and across ORM boundaries (Mongoid calling ActiveRecord). The gem provides configurable notifications (Rails logger, custom logger, STDERR, raise exceptions) and middleware for Rack and Sidekiq. It supports both MySQL (built-in fingerprinting) and PostgreSQL (via pg_query gem) adapters. The architecture is a single module with thread-local state for scan mode, a subscription to sql.active_record, and a notification aggregator. It includes a comprehensive test suite using Minitest and FactoryBot against SQLite.

RATING: 8.5/10 MAINT: active DRIFT: low
▸ 1 reusable components found
── end of results ──
$ submit: