Skip to content

Conversation

@astandrik
Copy link
Collaborator

@astandrik astandrik commented Dec 2, 2025

Closes #2532

Greptile Overview

Greptile Summary

Added context menu option to create vector indexes on row tables. The implementation follows existing patterns consistently across the codebase.

  • Added addVectorIndex query template with comprehensive SQL example using vector_kmeans_tree algorithm
  • Integrated the action into both schema tree and SQL query context menus
  • Properly scoped to row tables only (not column tables), consistent with regular index behavior
  • Includes helpful documentation link and sensible default values for all vector index parameters
  • Added English translations for the new menu item in both locations

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is straightforward, follows existing patterns exactly, and only adds new functionality without modifying existing code. The changes are well-structured across the appropriate files with proper integration points.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
src/containers/Tenant/utils/schemaQueryTemplates.ts 5/5 Added addVectorIndex template function with comprehensive SQL example for creating vector indexes
src/containers/Tenant/utils/schemaActions.tsx 5/5 Imported and integrated addVectorIndex action into schema context menu for row tables
src/containers/Tenant/utils/newSQLQueryActions.ts 5/5 Imported and bound addVectorIndex template to action in SQL query actions
src/containers/Tenant/Query/NewSQL/NewSQL.tsx 5/5 Added vector index menu item to SQL query context menu between regular index and drop index items

Sequence Diagram

sequenceDiagram
    participant User
    participant ContextMenu
    participant Actions
    participant QueryTemplate
    participant SQLEditor

    User->>ContextMenu: Right-click table in schema tree
    ContextMenu->>ContextMenu: Display "Add vector index..." option
    User->>ContextMenu: Click "Add vector index..."
    ContextMenu->>Actions: Call addVectorIndex action
    Actions->>QueryTemplate: Call addVectorIndex(params)
    QueryTemplate->>QueryTemplate: Generate SQL template with placeholders
    Note over QueryTemplate: Uses table path from params<br/>or ${1:<my_table>} placeholder
    QueryTemplate-->>Actions: Return SQL template string
    Actions->>SQLEditor: Insert SQL template into editor
    SQLEditor->>User: Display editable SQL with tab stops
    Note over User,SQLEditor: User can tab through placeholders:<br/>${2:my_vector_index}, ${3:embedding},<br/>${4:512}, ${5:2}, ${6:128}
Loading

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
378 374 0 2 2
Test Changes Summary ⏭️2

⏭️ Skipped Tests (2)

  1. Scroll to row, get shareable link, navigate to URL and verify row is scrolled into view (tenant/diagnostics/tabs/queries.test.ts)
  2. Copy result button copies to clipboard (tenant/queryEditor/queryEditor.test.ts)

Bundle Size: ✅

Current: 62.33 MB | Main: 62.33 MB
Diff: +1.86 KB (0.00%)

✅ Bundle size unchanged.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

Copilot AI review requested due to automatic review settings December 2, 2025 10:23
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copilot finished reviewing on behalf of astandrik December 2, 2025 10:26
Copy link
Contributor

Copilot AI left a comment

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 a context menu option to create vector indexes on tables in the YDB Embedded UI. The feature provides users with a template SQL query for creating vector indexes using the vector_kmeans_tree method with configurable parameters.

Key changes:

  • Adds addVectorIndexTemplate function that generates SQL for creating vector indexes
  • Integrates the new action into schema context menus and SQL query action menus
  • Includes proper internationalization for menu items in English

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/containers/Tenant/utils/schemaQueryTemplates.ts Adds addVectorIndexTemplate function to generate vector index creation SQL with documentation link and configurable parameters
src/containers/Tenant/utils/schemaActions.tsx Imports and wires up the vector index template to the schema tree context menu actions
src/containers/Tenant/utils/newSQLQueryActions.ts Imports and binds the vector index template to SQL query editor action menu
src/containers/Tenant/i18n/en.json Adds English i18n key actions.addVectorIndex for the context menu item
src/containers/Tenant/Query/NewSQL/i18n/en.json Adds English i18n key action.add-vector-index for the SQL editor menu item
src/containers/Tenant/Query/NewSQL/NewSQL.tsx Adds the vector index action to the SQL editor's action menu

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

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.

Context menu to create a vector index

2 participants