Commit Graph

29 Commits

Author SHA1 Message Date
t8y2 60632ccfe3 feat(completion): expand sql semantic completion 2026-06-12 19:15:46 +08:00
t8y2 d0a009751a feat(completion): improve sql completion ranking 2026-06-12 18:52:34 +08:00
t8y2 6570e88e4a feat(completion): rank table acronym matches 2026-06-12 18:38:56 +08:00
t8y2 c9d655324d fix(editor): preserve IME composition in comments 2026-06-11 22:55:16 +08:00
t8y2 edba8214b5 feat: show username/password fields for Access database connections 2026-06-10 08:37:18 +08:00
t8y2 d08385e75f feat: add Turso/libSQL database support
Turso is a distributed SQLite database built on libSQL, offering HTTP-based
connectivity with auth token authentication. This change adds full support:

- New DatabaseType::Turso and PoolKind::Turso variants
- TursoClient driver using libSQL HTTP pipeline API (/v2/pipeline)
- Bearer token auth via password or url_params (auth_token=)
- Multi-statement batch pipeline for transactional integrity
- Standalone BEGIN/COMMIT/ROLLBACK treated as no-ops (pipeline is auto-commit)
- Full metadata support: tables, columns, indexes, foreign keys, triggers, DDL
- Frontend: connection form, SQL completion (SQLite syntax), capability sets
- Built-in databases (SQLite/Turso/DuckDB/RQLite/Access) placed first in selector
- Unit tests (15) + integration tests against live libsql-server (12)
- Single connection pool, skips TCP probe

Closes #948
2026-06-10 04:18:05 +08:00
Yong Studt 2628fb8374
feat(elasticsearch): add SQL-model execution with mapping-aware completion
- Route SELECT * FROM <index> through /_search for simple browses; aggregates/projections stay on /_sql
- Drive completion columns from /_mapping (flattened dotted fields, multi-fields)
- Switch editor completion to SQL when the active statement starts with SELECT/WITH on ES
- Skip generic SQL semantic diagnostics for ES (hyphenated wildcard indices caused 500s)
- Wire ES into server-side pagination plan; derive completion context from line blocks
- Fix result-grid pagination exceeding in-memory result sets (allRowsLoaded)
2026-06-08 17:53:05 +08:00
vrustx e3087e0954
fix(sql): rank referenced-table columns above keywords in completion (#801) (#810)
When editing SQL with concrete tables already referenced (a FROM clause,
a "table." qualifier, or an INSERT column list), column completions only
carried `computeBoost + keyBoost (0/500)` — lower than keyword boosts
(1200-1900) — so the table's own columns were interleaved among keywords
instead of ranking at the top where the user expects them.

Give columns a relevance boost (+2000) in these referenced-table contexts
so they rank above plain keywords. Added a unit test asserting columns
outrank keywords when a table is referenced.

Co-authored-by: vrustx <vrustx@vrustxdeMac-mini.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 13:53:58 +08:00
t8y2 0887b96236 feat: add rqlite database support 2026-06-05 01:02:07 +08:00
t8y2 4964bb697d fix(completion): preserve whitespace SQL contexts 2026-06-04 00:09:48 +08:00
t8y2 085a2f3870 feat(completion): add database-specific suggestions 2026-06-03 20:47:17 +08:00
t8y2 0f40f6cd0c fix(postgres): support quoted schema autocomplete 2026-06-03 17:00:24 +08:00
t8y2 967b9df604 feat(editor): show column comments in SQL completions 2026-06-03 14:05:30 +08:00
t8y2 cc74fabad7 feat(completion): suggest database routines 2026-06-03 11:27:31 +08:00
t8y2 a54c8cfd93 feat(sql): suggest join conditions from foreign keys 2026-06-02 18:08:06 +08:00
t8y2 41e97baa6e fix(desktop): scope SQL alias completions to columns 2026-06-01 19:31:49 +08:00
t8y2 e515933ab3 fix(sql): quote postgres completion identifiers 2026-06-01 17:13:42 +08:00
t8y2 4b00bf8215 fix(sql): improve completion ranking and fuzzy table lookup 2026-06-01 14:04:54 +08:00
t8y2 ed1db7db6b fix(ui): localize hardcoded strings 2026-05-30 10:01:12 +08:00
t8y2 1d2fec4aee perf(editor): optimize SQL autocomplete responsiveness
- Add 150ms debounce on async completion path to reduce redundant Tauri IPC calls during rapid typing
- Parallelize schema table fetching with max concurrency of 5
- Separate schema list cache from table completion cache for longer-lived reuse
- Return keyword completions synchronously when no backend data is needed
- Lower snippet base boost for label-only matches so keywords rank above snippets when user types past snippet prefix
2026-05-28 23:31:31 +08:00
t8y2 915728ebec fix(editor): refresh SQL snippet completion after settings changes 2026-05-27 17:46:16 +08:00
t8y2 7fa056f57c fix: boost high-frequency SQL keywords in completion ranking
Typing "WH" now ranks WHERE above WHEN since WHERE is far more
commonly used. High-frequency keywords (SELECT, FROM, WHERE, JOIN,
etc.) get a +100 boost so usage frequency outweighs length-based
tie-breaking.

Fixes #459
2026-05-26 16:12:13 +08:00
t8y2 1b8355e7e6 style: fix frontend formatting (oxfmt) 2026-05-25 10:59:30 +08:00
t8y2 6107778358 feat: support customizable SQL snippet templates with custom trigger keys
Users can now create, edit, and delete SQL snippet templates from the settings dialog (new "Snippets" tab). Each template has a label, trigger prefix, and SQL body. Built-in defaults are modifiable and can be restored. Templates persist across sessions via the existing settings storage.
2026-05-25 01:43:09 +08:00
t8y2 24c334ef61 feat(i18n): add completion and search translations, remove hardcoded Chinese strings
- Add editor.completion (46 keys) and editor.search (10 keys) i18n sections
  across zh-CN, en, es locales, including 38 SQL function descriptions
- Create SqlCompletionTranslations interface in sqlCompletion.ts, pass via
  buildSqlCompletionItems/buildSqlCompletionItemsFromContext parameters
- Replace static FUNCTION_DESCRIPTIONS Map with getFunctionDescriptions(t?)
- Replace 11 hardcoded search toolbar strings in QueryEditor.vue with t()
- Fix YashanDB product label in connectionUrl.ts
2026-05-23 15:47:18 +08:00
t8y2 c7fa74f90c feat(sql): progressive autocomplete enhancements — fuzzy matching, type-aware hints, and more
- Fuzzy matching with character-order scoring (typo/abbreviation tolerant)
- Context-aware keyword filtering (DDL hidden in SELECT, etc.)
- CTE/subquery column resolution from parsed definitions
- INSERT column list completion
- Schema name completion
- Smart GROUP BY non-aggregated column suggestions
- Better FK join inference (shared FK, parent_id, created_by patterns)
- Table alias suggestions
- SELECT * expansion to explicit column list
- Type-aware comparison value hints (string/numeric/boolean/NULL)
- Function signature inline documentation (30+ functions)
- History-based learning ranking via recordCompletionSelection()
- Epoch-based request debouncing in QueryEditor.vue
- Irregular plural handling for singular table names
- Quoted identifier parsing for dots in names
2026-05-23 15:31:05 +08:00
t8y2 0e189ba0cc feat(editor): add SQL semantic diagnostics 2026-05-22 14:22:58 +08:00
t8y2 af5eb9cb2f fix(sql): narrow completion suggestions 2026-05-22 01:36:26 +08:00
t8y2 06683c57b1 chore(repo): move desktop app under apps 2026-05-18 02:35:39 +08:00