basecamp/marginalia
Attach comments to ActiveRecord's SQL queries observed · 2026-08-28
Health v2 · maintenance only
77/100
- Activity 99
- Release rhythm 35
- Longevity 100
Flags: no_releases
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 5288
- days_rel: n/a
- days_push: 9
- n_releases_24m: 0
Adoption not part of the score
1768 stars · 148 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A Ruby gem that appends contextual comments (application, controller, action) to ActiveRecord SQL queries. It helps trace slow queries back to the code that generated them, and its functionality is built into Rails 7+ as QueryLogs.
Use cases
- trace slow sql queries back to rails controller actions
- annotate activerecord queries with application context
- find which endpoints generate slow database queries
- search database logs for queries by controller
- integrate query comments with pt-query-digest
When to choose
- you run a Rails 5.2-6.1 app and need query provenance in logs or slow query analysis
- you want to identify controller/action hotspots using tools like pt-query-digest
When to avoid
- you are on Rails 7 or newer, where query logging is built in via ActiveRecord::QueryLogs
- you do not use ActiveRecord or a supported adapter (mysql2, pg, sqlite3)
Facets
library · maturity maintenance
logging monitoring middleware databases developer-tools web-development performance ruby activerecord rails sql-comments query-tracing database-debugging web-server
1 source
- readme: https://github.com/basecamp/marginalia · fetched 2026-08-28 · 69285f88ac79
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| basecamp/marginalia | main | 77 |
For agents
markdown · JSON · MCP: product_card(name="basecamp/marginalia")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem