Skip to content

feat(web): add SQL autocomplete#51

Merged
omercnet merged 6 commits into
mainfrom
feat/sql-autocomplete
Jun 29, 2026
Merged

feat(web): add SQL autocomplete#51
omercnet merged 6 commits into
mainfrom
feat/sql-autocomplete

Conversation

@omercnet

@omercnet omercnet commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add CodeMirror SQL schema reconfiguration for table/field autocomplete
  • wire loaded table metadata into the SQL tab and fetch fields only when SQL tab is active
  • document autocomplete in README and docs site

Verification

  • npm run build
  • npm test
  • npm run coverage
  • node --check web/sql-tab.js web/app.js web/vendor/src/codemirror6.entry.js web/app.test.js

Summary by cubic

Add schema‑aware SQL autocomplete to the SQL tab that suggests tables and columns from your query’s relations. Columns load only when the SQL tab is active to keep things fast.

  • New Features

    • Table and relation‑aware column autocomplete in the CodeMirror SQL editor.
    • Columns are fetched lazily when the SQL tab is active; textarea mode skips fetches.
    • Resilient fetching: ignores stale responses on DB switch and swallows errors; default schema is "public" or the first available.
    • New editor API setSQLConfig; app passes tables into SqlTab; README and docs updated.
  • Bug Fixes

    • Column completion now sources only from relations in the current query and doesn’t override table suggestions while typing.
    • Avoids bare column completions when duplicate table names exist across schemas.
    • Autocomplete popup is themed to match the app.

Written for commit 4d6f9fa. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 6 files

Re-trigger cubic

Comment thread web/codemirror6-entry.test.js Fixed

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 5 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread web/codemirror6-entry.test.js Outdated
@omercnet omercnet enabled auto-merge (squash) June 29, 2026 11:01
@omercnet omercnet disabled auto-merge June 29, 2026 11:01
@omercnet omercnet merged commit 553b78c into main Jun 29, 2026
17 checks passed
@omercnet omercnet deleted the feat/sql-autocomplete branch June 29, 2026 11:01
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.

2 participants