Most of Reports-bot works by querying the database, generating a list of page titles (with the occasional annotation), and then posting them on a wiki page in a standard manner. See examples:
- Database Reports: WikiProject Watchers
- WikiProject Hampshire: Not tagged (but potentially in the project scope)
In principle, many of these functions could be handled by an extension that generated database reports on demand that could be transcluded on pages.
As I understand it, MediaWiki used to let you do SQL queries within MediaWiki itself; this was killed for performance reasons. If we were to revisit this we would need strategies to prevent overload, including caching and query timeouts.
From a user experience perspective, it might not necessarily work exactly like an SQL query interface like Quarry. Rather, the extension would produce reports with clickable links, etc. that make them more useful to editors than the usual plaintext output of SQL queries. If we are feeling especially ambitious, we could build in a query builder that makes it so that people without knowledge of SQL or the MediaWiki database architecture could put together some basic reports.