Skip to content

fix(editor): handle qualified tables in grid editing - #660

Open
debba wants to merge 2 commits into
mainfrom
fix/issue-659-qualified-grid-tables
Open

fix(editor): handle qualified tables in grid editing#660
debba wants to merge 2 commits into
mainfrom
fix/issue-659-qualified-grid-tables

Conversation

@debba

@debba debba commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix grid editing and autocomplete for queries that qualify a table with the active schema or database, such as:

SELECT * FROM Ops.Addresses;

The table extractor previously treated Ops as the table name, so primary key lookup failed and the grid reported that Ops had no primary key.

The extractor now resolves Addresses when Ops matches the active database. A mismatched qualifier remains non-editable to prevent writes from targeting a table with the same name in the wrong database.

Autocomplete now keeps the database associated with each loaded table. Typing Ops. in a table position suggests tables from Ops, while Ops.Addresses. and table aliases continue to suggest columns.

Testing

  • Added coverage for unquoted and quoted qualified identifiers
  • Added coverage for missing and mismatched active schemas
  • Added autocomplete coverage for full and partial database-qualified table names
  • Added registration coverage for single and multi-database connections
  • Ran the full test suite: 3,817 tests passed
  • Ran TypeScript type checking and ESLint
  • Verified an update against Ops.Addresses on MySQL 8.4

Closes #659

@debba
debba force-pushed the fix/issue-659-qualified-grid-tables branch from 8edfaa9 to e99be83 Compare August 18, 2026 19:16
@kilo-code-bot

kilo-code-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (7 files)
  • src/pages/Editor.tsx
  • src/utils/sql.ts
  • src/hooks/useSqlAutocompleteRegistration.ts
  • src/utils/autocomplete.ts
  • tests/hooks/useSqlAutocompleteRegistration.test.ts
  • tests/utils/autocomplete.test.ts
  • tests/utils/sql.test.ts

Reviewed by glm-5.2 · Input: 40.1K · Output: 12.6K · Cached: 260.5K

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.

[Feat]: grid editor should properly handle explicitly declared schemas/databases

1 participant