pawurb/rails-pg-extras
59.4
Adequate · 20 September 2026
509
lines of production code
Ruby
primary language
1
measurement over time
What this system is
This system is a Ruby gem that provides PostgreSQL diagnostic and maintenance tools for Rails applications. It offers a web dashboard for monitoring database health, executing administrative actions, and viewing query metrics, alongside command-line Rake tasks for similar operations. The library supports multi-database environments and includes integration with the Model Context Protocol for external tool access.
How it got here
2019 — Multi-version PostgreSQL support and dependency refactoring
4 changes.
The project expanded its testing infrastructure to support PostgreSQL versions 12 through 18 via Rake tasks and Docker Compose, while enhancing the library to handle multiple database connections and improved query diagnostics. Concurrently, internal structure was cleaned up by removing local version files and explicitly declaring gem dependencies, including a new requirement for multi-factor authentication during publication.
2020–2024 — Web dashboard and diagnostic expansion
10 changes.
This period focused on building a comprehensive web-based dashboard for RailsPgExtras, featuring Tailwind CSS styling, authentication, and multi-database support. The work expanded the library's capabilities by adding Rake tasks for health checks, integrating Model Context Protocol (MCP) support, and establishing a robust test suite to ensure reliability.
Features
Add multi-version PostgreSQL testing and sample Docker setup
The project now includes a Rake task and a sample Docker Compose file to facilitate testing and development against PostgreSQL versions 13 through 18. The \Rakefile\ defines a \test\_all\ task that runs the test suite sequentially against PG 12–17, while \docker-compose.yml.sample\ provides pre-configured containers for PG 13–18 with the \pg\_stat\_statements\ extension pre-loaded, simplifying local environment setup for developers.
(repo-wide) · high confidence
Add web application layout with Tailwind CSS and database selector
The Rails Pg Extras web interface now uses a dedicated layout file that applies Tailwind CSS for styling and includes a database selector component. This layout renders flash notices and alerts with distinct visual styles and dynamically displays the application version in the page title.
app/views/layouts · high confidence
Added Rake tasks for PostgreSQL health checks and metadata metrics
Users can now run new Rake tasks to generate a PostgreSQL healthcheck report (\pg\_extras:diagnose\) and display metadata metrics for tables (\pg\_extras:table\_info\) and indexes (\pg\_extras:index\_info\). These tasks are registered in the \pg\_extras\ namespace and require the Rails environment to function, providing direct access to diagnostic and informational queries previously available only through the library's core methods.
_lib/rails\_pg\extras/tasks · high confidence
Added local Rails UJS and Tailwind CSS assets
The application now includes local copies of the Rails Unobtrusive JavaScript (ujs) library and a minified Tailwind CSS v2.2.19 stylesheet in the assets directory. The JavaScript file provides standard Rails UJS functionality for handling remote links, forms, and CSRF protection, while the CSS file applies the Tailwind utility classes for styling.
assets · high confidence
Initial route configuration for RailsPgExtras::Web engine
The application now defines its URL routing structure within \config/routes.rb\ for the \RailsPgExtras::Web::Engine\. This configuration establishes the index page for queries as the root path and exposes specific POST endpoints for administrative actions, including killing all processes, resetting pg\_stat\_statements, and adding database extensions.
config · high confidence
Introduce web-based PostgreSQL diagnostics and query interface
This change adds a new web UI for the \rails-pg-extras\ gem, providing a browser-accessible dashboard for database maintenance. Users can now view a diagnostic report highlighting potential performance issues, execute specific database actions (such as killing connections or resetting statistics) with confirmation prompts, and view query results in a formatted table. The interface includes warnings for unavailable extensions and allows users to enable them directly from the dashboard, while also supporting multi-database selection via a shared selector component.
_app/views/rails\_pg\extras/web/queries · high confidence
RailsPgExtras v5.7.0: Configurable web actions and MCP integration
RailsPgExtras has been updated to version 5.7.0, introducing a new configuration system that allows users to control which web dashboard actions are enabled (defaulting to excluding \kill\_all\ and \kill\_pid\) and to ignore specific missing foreign key constraints or indexes. The release also adds an initial integration with the Model Context Protocol (MCP), exposing database diagnostic tools and queries via a new MCP middleware, while maintaining the existing web dashboard capabilities.
_lib/rails\_pg\extras · high confidence
Removals
Removed local version and main entry files
The local \lib/rails-pg-extras/main.rb\ and \lib/rails-pg-extras/version.rb\ files have been deleted. This removes the hardcoded version string (previously 0.1.0) and the main entry point from this local directory, indicating that the library now relies on an external dependency or a different structure for its versioning and entry logic.
lib/rails-pg-extras · high confidence
Behavioural changes
Enable flash messages in Rails API mode
The RailsPgExtras::Web engine now explicitly includes ActionDispatch::Flash middleware, allowing flash messages to function correctly even when the host application is running in Rails API mode. Additionally, the engine configures static asset serving to ensure local JavaScript and CSS files are accessible.
_lib/rails\_pg\extras/web · high confidence
Introduce configurable web dashboard with authentication and action gating
The Rails Pg Extras web interface now includes a new controller layer that enforces HTTP basic authentication using Rails credentials or environment variables, with an optional public mode via the \RAILS\_PG\_EXTRAS\_PUBLIC\_DASHBOARD\ configuration. The dashboard supports dynamic database selection across multiple connections and allows administrators to enable or disable specific web actions (such as \kill\_all\, \pg\_stat\_statements\_reset\, and \add\_extensions\) independently, ensuring that only permitted operations are exposed to users.
app/controllers · high confidence
Support for multi-database selection and query navigation in the web UI
The web interface now allows users to switch between multiple database connections and select specific diagnostic queries. A new database selector dropdown appears when more than one database is available, automatically submitting the form upon selection to switch context. Similarly, a query selector dropdown enables choosing specific queries to diagnose, with logic to preserve the selected database when changing queries. Both selectors use inline JavaScript with nonces to comply with Content Security Policy (CSP) requirements.
_app/views/rails\_pg\extras/web/shared · high confidence
Support for multiple database connections and improved query diagnostics
The library now supports connecting to multiple databases dynamically via thread-local selection or explicit configuration, ensuring that diagnostic queries do not overwrite the global ActiveRecord connection. It introduces new \index\_info\ and \table\_info\ commands for retrieving metadata, enhances the \diagnose\ method with flexible output formats, and adds a \measure\_queries\ feature that tracks SQL execution counts and durations using ActiveSupport notifications.
lib · high confidence
Test coverage
Initial test suite for RailsPgExtras
Added a new RSpec test suite to verify the core functionality of the RailsPgExtras library. The tests confirm that standard diagnostic queries (such as index and table info) execute without error, that custom database configuration via environment variables works correctly, and that setting a specific database config does not interfere with the global ActiveRecord connection. The test infrastructure also ensures necessary PostgreSQL extensions (pg\_stat\_statements, pg\_buffercache, sslinfo) are available during execution.
spec · high confidence
Dependencies
Refactor gem dependencies and add MFA requirement
The gemspec now explicitly declares runtime dependencies on 'ruby-pg-extras', 'railties', and 'actionpack' (in addition to the existing 'activerecord'), and adds development dependencies for 'rake', 'rspec', and 'rufo'. It also introduces a metadata field requiring multi-factor authentication (MFA) for gem publication.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 59.
Lenses
- Code Health 100
- Architecture 69
- Maturity 57
- Readiness 51
- Security 99
- Accessibility 67
Changes since last survey
- 224 commits — 183 feature/other, 41 fixes
By area
- (root) — 110 commits
- lib/rails_pg_extras — 43 commits
- lib/rails-pg-extras — 36 commits
- app/views — 11 commits
- lib/rails-pg-extras.rb — 6 commits
- .circleci/config.yml — 5 commits
- .github/workflows — 5 commits
- app/controllers — 3 commits
- (repo) — 1 commit
- assets/pg-extras-tailwind.min.css — 1 commit
- config/routes.rb — 1 commit
- spec/smoke_spec.rb — 1 commit
- spec/spec_helper.rb — 1 commit
Notable commits
- fix: Bugfix
- fix: Bugfix
- fix: Docs explain how to target an alternate schema [fixes #43] (#44)
- fix: Fix CI
- fix: Fix CI
- fix: Fix CI
- fix: Fix CI
- fix: Fix credentials auth
- fix: Fix css
- fix: Fix css
- fix: Fix custom URL connection
- fix: Fix dependency bug
- fix: Fix language stats
- fix: Fix loading rake tasks
- fix: Fix local connections for rake tasks (#34)
- fix: Fix missing methods
- fix: Fix null_indexes arg
- fix: Fix python link
- fix: Fix requires
- fix: Fix spec
- …and 204 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
pawurb/rails-pg-extras was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 628f8c91c4fcd84ceeb8b8f369b83bd23ac8da20 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.