Repository navigation
feat(utilities): SQL Tracer — live sessions and Fox activity - #564
Merged
Merged
Conversation
…d and time-boxed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 6d5774f5-bc13-4b99-89bf-f8aadff467b2) |
Contributor
Test IDsAdded (15)
|
This was referenced Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Utilities → SQL Tracer (Phase 1): watch the statements on a saved connection.
Safety and bounds:
utility.trace(Owner and Admin by default; one-time grant on upgrade to roles that haveschema.migrate). Every route needs it, and the Utilities entry is hidden without it.IDENTIFIED BY,PASSWORD, secrets, keys, tokens, URL and connection-string passwords, RedisAUTH), then cut at 8,000 characters. Errors are redacted too, since they can quote the statement.Design
platform/sql-activity: a listen/report feed in the feature context. The SQL editor reports afterrunStatements; the tracer listens per connection.features/sql-trace:SqlTraceService(sessions, lazy expiry, no timers) and routesPOST /start,GET /:id/events?after=,POST /:id/stop.@foxschema/sql:redactSqlText,traceText, and trace types and bounds; the types are exported via ui-shared.SqlTracerPanel(mode, start/stop, filter, grid, detail pane with Open in editor).Test plan
apps/webtsc, fullnpx vitest run: 6,614 pass.utilities-sql-tracer2/2 (SQLite Fox activity, Postgres live).sql-editor-utilitiesstill passes 8/8.🤖 Generated with Claude Code
Note
High Risk
Introduces permission-gated APIs and in-memory capture of other users' SQL (with redaction), plus live DB session polling that holds connection credentials for active traces.
Overview
Adds Utilities → SQL Tracer so users with
utility.tracecan watch SQL on a saved connection for up to 15 minutes.Fox activity streams statements executed through Fox (SQL editor
/api/sql/execute) via a new in-processSqlActivityFeedwired from the editor intoSqlTraceService. Live polls the existing DBA sessions probe about once per second on engines that support it.The server exposes
/api/sql-trace/start,/:id/events, and/:id/stopwith RBAC, per-user trace limits, and server-side redaction/truncation (redactSqlText/traceText). The web UI addsSqlTracerPanel(start/stop, filter, detail, open in editor) behind the new nav entry; remembered tool choice falls back if permission is lost.Also adds unit/route/e2e coverage (
utilities-sql-tracer), test IDs, docs, and a one-time RBAC grant for roles that already haveschema.migrate.Reviewed by Cursor Bugbot for commit 3bba95a. Bugbot is set up for automated code reviews on this repo. Configure here.