Skip to content

feat(editor): add SQL language support#264

Closed
amaralkaff wants to merge 6 commits into
crynta:mainfrom
amaralkaff:feat/sql-syntax
Closed

feat(editor): add SQL language support#264
amaralkaff wants to merge 6 commits into
crynta:mainfrom
amaralkaff:feat/sql-syntax

Conversation

@amaralkaff
Copy link
Copy Markdown
Contributor

@amaralkaff amaralkaff commented May 15, 2026

What

Adds CodeMirror SQL language support so .sql files (and common dialect extensions) get syntax highlighting in the editor.

Why

SQL files currently render as plain text. Mirrors the pattern from #127 (Go support).

How

  • package.json: add @codemirror/lang-sql (~30 KB gzipped, ships all dialects)
  • src/modules/editor/lib/languageResolver.ts: add loaders for sql (StandardSQL), psql/pgsql (PostgreSQL), mysql (MySQL), sqlite (SQLite). One package, dialect picked per extension.

Testing

  • pnpm exec tsc --noEmit clean
  • Manual smoke-test of the affected feature
  • (If you touched src-tauri/) cargo check clean — N/A, no src-tauri/ changes; pnpm tauri dev builds clean
  • (If UI) tested in pnpm tauri dev — opened .sql, .psql, .mysql, .sqlite files; keywords/strings/comments highlight per dialect

Screenshots / GIFs

N/A — pure language pack registration, no visual UI change beyond editor token colors.

Notes for reviewer

Same shape as #127. Bundle impact is one dynamic-imported chunk that only loads when a matching file is opened.

@amaralkaff amaralkaff requested a review from crynta as a code owner May 15, 2026 10:06
@crynta
Copy link
Copy Markdown
Owner

crynta commented May 19, 2026

Thanks for the PR. Ended up going with @codemirror/legacy-modes/mode/sql instead in ee1c9bb (already bundled for Ruby/C/etc, ~20KB smaller, covers more dialects: standardSQL, mySQL, pgSQL, sqlite, mariaDB, msSQL, plSQL). No autocomplete from the parser-based lang-sql, but we don't have LSP anyway so visual highlighting is identical. Appreciate the push to add SQL support.

@crynta crynta closed this May 19, 2026
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