0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-07 13:19:19 +08:00
discourse/plugins/discourse-data-explorer
Rafael dos Santos Silva 7b025265d2
FEATURE: Add 25 default data explorer queries for traffic, health, moderation and audits (#41571)
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>
2026-07-09 12:58:39 -03:00
..
admin/assets/javascripts/admin UI: Add the DE search table hiding mechanism back per before (#41278) 2026-06-30 13:48:33 +08:00
app SECURITY: Group report details expose raw Data Explorer SQL to non-admin group members (#40919) 2026-06-16 13:46:19 -05:00
assets DEV: Bump prettier-plugin-ember-template-tag and reformat (#41489) 2026-07-06 19:18:44 +01:00
config DEV: Turn on AI data explorer queries by default (#41581) 2026-07-09 13:49:10 +08:00
db/migrate DEV: Check & resolve sequence issues during db:check_structure_dump (#40118) 2026-05-18 15:23:41 +01:00
lib FEATURE: Add 25 default data explorer queries for traffic, health, moderation and audits (#41571) 2026-07-09 12:58:39 -03:00
spec DEV: Turn on AI data explorer queries by default (#41581) 2026-07-09 13:49:10 +08:00
test/javascripts DEV: Turn on AI data explorer queries by default (#41581) 2026-07-09 13:49:10 +08:00
package.json DEV: Add a script for generating external types in discourse-types (#37095) 2026-03-09 20:37:43 +01:00
plugin.rb FEATURE: Add query examples for Data Explorer AI (#41288) 2026-07-01 15:07:28 +08:00
README.md
tsconfig.json DEV: Add a script for generating external types in discourse-types (#37095) 2026-03-09 20:37:43 +01:00

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