Skip to content

be: list every query adminer sends in tracy's bar, through dibi's sql panel - #194

Merged
landsman merged 5 commits into
mainfrom
be/tracy-sql-panel
Oct 24, 2026
Merged

landsman merged 5 commits into
mainfrom
be/tracy-sql-panel

Conversation

@landsman

@landsman landsman commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Under -debug, Tracy's bar now lists every query adminer sends — SQL, time, row count. No ready-made panel can see them, because adminer talks to mysqli, pgsql and PDO directly; patches/adminer-after-query.patch adds an afterQuery() hook to the bundled drivers (MySQLi, PgSQL, SQLite3, PdoDb), and Desktop\QueryLog replays each query into dibi's panel as an Event.

  • User queries are told apart from adminer's own. What a SQL command, a select with its filters or an edit ran is marked user, the rest app, through dibi's Connection column (it appears once there are two connections — both lazy, neither connects). User ones come first; the hooks that say so fire before or after the query, so rows are built when the bar renders.
  • The panel takes the window, not Tracy's 700×500 cap.
  • dibi is a dev dependency, so a release ships neither it nor the panel; Debug::plugins() checks for it.
  • No EXPLAIN and no source link. EXPLAIN reruns the query through dibi's connection, which never connects; the source would be the same line of the compiled adminer.php every time.
  • Upstream: Plugins: Add method afterQuery() vrana/adminer#1368; the patch goes once a release carries it.
  • Drops the Debug.php note that the bar renders blank; it renders.

Checked against a throwaway postgres: a pg_class select listed 72 queries / 35.2 ms. make qa, make check and make e2e (both drivers) pass. make e2e-packaged fails a few scenarios, a different set each run, and does the same on main.

Screenshot 2026-10-24 at 11 41 13 PM

@greptile-apps

greptile-apps Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No established blocking issue remains; the PR appears safe to merge.

Summary

Adds a debug-only SQL panel that sends Adminer queries to dibi’s Tracy panel.

  • The Tracy bar lists Adminer queries with timing and row counts.

No new actionable findings were established. The full PR diff was reviewed because the previous and current commits have different merge bases with the target commit.

landsman declined the earlier test-coverage suggestion because a debug-only test would need a second server and Tracy would interfere with layout checks. Greptile withdrew it.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Adminer sends SQL] --> B[Patched driver]
  B --> C[afterQuery]
  C --> D[QueryLog stores SQL, time, and rows]
  E[User-query hooks] --> F[QueryLog records user SQL]
  D --> G[Tracy requests the tab]
  F --> G
  G --> H[Build dibi events, user queries first]
  H --> I[Render the SQL panel]
Loading

Reviews (6) · Last reviewed commit: "be: leave $query untyped in the mysqli o..." · Reviewed by Greptile

Comment thread app/src/QueryLog.php Resolved
… panel

No ready-made panel sees adminer's queries: it talks to mysqli, pgsql and PDO directly. A patch adds an afterQuery hook to the bundled drivers until upstream has one, and Desktop\QueryLog replays each query into dibi's panel under -debug. dibi is a dev dependency, so a release ships neither.
…it fill the window

A SQL command, a select with its filters or an edit is what you are debugging; it was lost among the dozens of queries adminer runs around it. Each is now marked user or app through dibi's Connection column, user ones first. Tracy's 700x500 cap also hid most of the list.
@landsman
landsman merged commit d92ead3 into main Oct 24, 2026
7 checks passed
@landsman
landsman deleted the be/tracy-sql-panel branch October 24, 2026 23:04
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.

1 participant