Add Studio Query Insights#1515
Open
sorenbs wants to merge 11 commits into
Open
Conversation
|
Compute preview deployed. Branch: |
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
Adds Studio-owned Query Insights and moves the Console Query Insights experience into the Studio surface behind the optional adapter/BFF bridge. The new
Queriesnavigation item appears directly underVisualizeronly when the adapter providesqueryInsights; stale#view=queriesURLs fall back to the normal default view when the capability is absent.Also updates the SQL view AI flow so generated SQL is validated and corrected before it is shown, and replaces SQL result visualizations with Studio-owned Bklit chart configs/components.
Screenshots
Queries view
Query analysis details
SQL result visualization
Query Insights
Adapter.queryInsightscontract and BFFprocedure: "query-insights"snapshot bridge.#view=queries.README.md,FEATURES.md, andArchitecture/query-insights.md, including the lowest-fidelity provider Studio supports, counter semantics, traffic exclusion, sanitization, sidecar topology, and sqlcommenter metadata mapping.pnpm demo:ppgthat records successful demo BFF query executions and excludes Studio metadata/lint/introspection traffic.Query Insights UI And Data Model
Queriesview with a live activity chart, table filter/sort controls, query list, and detail sheet.1m,5m,15m, or1h.ReadsUI toRows Returnedwhile retaining reads as an internal/advisory signal.Query Insights AI Analysis
llm({ task: "query-insights", prompt })hook instead of adding a Query-specific AI transport.Analysiscolumn with queued/running state, manualAnalyze, and completedGood,Info, orWarnbadges.SQL AI Generation
sqlLintcapability before inserting it into the editor.SQL Result Visualization
bar,horizontal-bar,line,pie,doughnut, and stackedbar/horizontal-barcharts.Demo And Dependencies
@prisma/devdependency available for this branch.impeccableskill into.agents/skills/impeccableand updates repo agent guidance for future UI work.ui/components/charts.Validation
pnpm typecheckpnpm test ui/hooks/use-introspection.test.tsx ui/studio/tanstack-db-performance-architecture.test.ts ui/studio/CommandPalette.test.tsx ui/studio/Navigation.test.tsx ui/studio/Studio.test.tsx ui/studio/views/queries/QueriesView.test.tsx ui/studio/views/queries/query-insights-ai.test.ts ui/studio/views/sql/SqlView.test.tsx ui/studio/views/sql/sql-ai-generation.test.ts ui/studio/views/sql/sql-result-visualization.test.tsx data/bff/bff-client.test.ts demo/ppg-dev/query-insights.test.ts demo/ppg-dev/config.test.ts ui/components/ui/select.test.tsx -- --runpnpm buildCOREPACK_ENABLE_STRICT=0 pnpm check:exportspnpm exec eslint ui/hooks/use-introspection.test.tsx ui/studio/CommandPalette.test.tsx ui/studio/tanstack-db-performance-architecture.test.ts ui/studio/views/queries/QueriesView.tsx ui/studio/views/queries/query-insights-ai.ts ui/studio/views/sql/SqlView.tsx ui/studio/views/sql/SqlResultVisualization.tsx ui/studio/views/sql/sql-ai-generation.ts ui/studio/views/sql/sql-result-visualization.ts data/bff/bff-client.ts demo/ppg-dev/query-insights.ts demo/ppg-dev/server.ts ui/studio/Navigation.tsx ui/studio/Studio.tsx ui/components/ui/select.tsxhttp://localhost:4310/#view=queriesandhttp://localhost:4310/#view=sqlNote: a full
pnpm test -- --runpass printed all test-file success lines after the test-harness fixes, but Vitest retained a worker process and did not return to the shell. The focused regression suite above exits cleanly.