mirror of
https://github.com/discourse/discourse.git
synced 2026-08-07 13:19:19 +08:00
Previously, the data explorer shipped only 19 default queries, mostly focused on user engagement curiosities, leaving the most common admin needs — traffic reporting, community health trends, moderation reporting, and permission/promotion audits — to be rediscovered over and over in Meta support topics. This change adds 25 curated default queries (ids `-20` to `-44`) covering those areas, sourced from Meta's saved query library and staff-authored answers in support topics, with stale hardcoded values generalized into parameters and known bugs fixed (overlapping histogram buckets, admin-only staff filters, row-multiplying joins replaced with `reviewable_scores`-based logic). Queries that depend on optional features (locale detection, browser pageview collection) carry an explicit warning in their description naming the required setting. Beyond being directly useful, the set is deliberately written as a learning corpus for the AI agent that helps admins create new queries (and for humans modifying them): together they demonstrate nearly every parameter type and the common patterns — relative time windows, gapless `generate_series` series, `FILTER` aggregates, anti-joins, window functions, nullable optional filters — with inline comments decoding non-obvious internals such as `user_histories` action codes and bot account id conventions. All 25 queries are verified to execute against a live database, and the rebuilt flag reports were smoke-tested with real flag data. --------- Co-authored-by: Natalie Tay <1555215+nattsw@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| admin/assets/javascripts/admin | ||
| app | ||
| assets | ||
| config | ||
| db/migrate | ||
| lib | ||
| spec | ||
| test/javascripts | ||
| package.json | ||
| plugin.rb | ||
| README.md | ||
| tsconfig.json | ||
Data Explorer Plugin
This plugin allows admins to run SQL queries against the live Discourse database, including parameterized queries and formatting for several common column types.
For more information, please see: https://meta.discourse.org/t/data-explorer-plugin/32566