Skip to content

feat(runner): adds sql query runner ai tab auto completion - #223

Closed
Rudra-Sankha-Sinhamahapatra wants to merge 46 commits into
mainfrom
feat/sql-auto-completions
Closed

feat(runner): adds sql query runner ai tab auto completion#223
Rudra-Sankha-Sinhamahapatra wants to merge 46 commits into
mainfrom
feat/sql-auto-completions

Conversation

@Rudra-Sankha-Sinhamahapatra

@Rudra-Sankha-Sinhamahapatra Rudra-Sankha-Sinhamahapatra commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Description of Changes

  • What was changed?
  • Added TAB AI suggestions ( ai will generate and if user clicks tab it will auto complete it)
  • Why was it changed?
    To make things easy for the user with ai based suggestions directly on monaco code editor
  • Any related issues or discussions?

Closes #221 (If applicable, delete this line if not)

Checklist

  • My changes are scoped and focused
  • I have tested the code locally

Notes to reviewer

  • Are there any specific things the reviewer should focus on?

Here's the screen recording

Screen.Recording.2025-12-05.at.7.mp4

cc: @letstri @geekyharsh05

@railway-app

railway-app Bot commented Dec 5, 2025

Copy link
Copy Markdown

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 monacopilot dependency 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.

Comment thread apps/api/src/orpc/routers/ai/code-completion.ts Outdated
Comment thread apps/api/package.json Outdated
Comment thread apps/desktop/package.json Outdated
Comment thread apps/api/src/orpc/routers/ai/code-completion.ts Outdated
@Rudra-Sankha-Sinhamahapatra Rudra-Sankha-Sinhamahapatra changed the title feat: adds sql query runner ai tab auto completion feat(runner): adds sql query runner ai tab auto completion Jan 29, 2026
@letstri

letstri commented Feb 16, 2026

Copy link
Copy Markdown
Member

After many tests, unfortunately, I decided not to accept this PR.

@letstri letstri closed this Feb 16, 2026
@letstri
letstri deleted the feat/sql-auto-completions branch February 16, 2026 22:23
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.

Add tab autocomplete to the runner

4 participants