Skip to content

Plugins: Add method afterQuery() - #1368

Closed
landsman wants to merge 1 commit into
vrana:mainfrom
landsman:after-query-hook
Closed

landsman wants to merge 1 commit into
vrana:mainfrom
landsman:after-query-hook

Conversation

@landsman

Copy link
Copy Markdown
Contributor

Add an afterQuery() hook, called after every query a driver sends, with the query, its time in seconds and the result. It lets a plugin profile what Adminer runs — e.g. feed a debug bar's SQL panel — which no existing hook reaches: messageQuery() and sqlCommandQuery() see only the queries the user is shown.

query_done() calls the hook and returns the result, so each driver's query() wraps its return values. Covered: MySQLi (query() and multi_query() overridden, since it inherits them from \mysqli), PgSQL, SQLite3 and PdoDb, which the PDO drivers go through. Queries sent before the plugins are loaded are skipped. MS SQL, Oracle and the plugin drivers are not covered yet — happy to add them if the shape is right.

@vrana

vrana commented Oct 27, 2026

Copy link
Copy Markdown
Owner

I solved it in a more general way and for all drivers.

@landsman

Copy link
Copy Markdown
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants