feat(runner): adds sql query runner ai tab auto completion - #223
feat(runner): adds sql query runner ai tab auto completion#223Rudra-Sankha-Sinhamahapatra wants to merge 46 commits into
Conversation
|
This PR was not deployed automatically as @Rudra-Sankha-Sinhamahapatra does not have access to the Railway project. In order to get automatic PR deploys, please add @Rudra-Sankha-Sinhamahapatra to your workspace on Railway. |
There was a problem hiding this comment.
Pull request overview
This PR adds AI-powered tab autocompletion to the SQL query runner, enabling real-time intelligent code suggestions powered by Google's Gemini model. The feature integrates the monacopilot library with Monaco editor to provide context-aware SQL completions based on the database schema.
Key Changes:
- Implemented AI code completion endpoint using Google Gemini 2.0 Flash model with custom SQL-aware prompts
- Integrated monacopilot library in the runner editor with debounced requests and proper cleanup handling
- Added database schema context builder to provide AI with table, column, and enum information
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds monacopilot package dependency to the monorepo lockfile |
| apps/api/package.json | Adds monacopilot dependency to API package (appears unused) |
| apps/desktop/package.json | Adds monacopilot dependency to desktop application |
| apps/api/src/orpc/routers/ai/index.ts | Exports new codeCompletion endpoint in AI router |
| apps/api/src/orpc/routers/ai/code-completion.ts | Implements AI code completion endpoint with Gemini model and SQL-aware prompt engineering |
| apps/desktop/src/routes/(protected)/_protected/database/$id/sql/-components/runner/runner-editor.tsx | Integrates monacopilot with Monaco editor, implements debounced completion requests with cleanup logic |
| apps/desktop/src/entities/database/utils/monaco.ts | Adds databaseAICompletionContext function to build schema context for AI completions |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
apps/api/package.json:41
- The
monacopilotdependency appears to be unused in the API package. This is a frontend Monaco editor library and should only be included in the desktop app package. Consider removing this dependency from apps/api/package.json.
"loops": "catalog:",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…t/sql-auto-completions
3f9d557 to
b9f2149
Compare
…t/sql-auto-completions
…t/sql-auto-completions chore: merge with main
…t/sql-auto-completions refactor: merge with main
…t/sql-auto-completions
…t/sql-auto-completions
…t/sql-auto-completions
…t/sql-auto-completions
…t/sql-auto-completions
…t/sql-auto-completions
…t/sql-auto-completions
|
After many tests, unfortunately, I decided not to accept this PR. |
Description of Changes
To make things easy for the user with ai based suggestions directly on monaco code editor
Closes #221 (If applicable, delete this line if not)
Checklist
Notes to reviewer
Here's the screen recording
Screen.Recording.2025-12-05.at.7.mp4
cc: @letstri @geekyharsh05