Three independent connection-list bugs:
1. Multi-select drag only moved one row. The drag system tracks a single
draggedId and ignored selectedTreeNodeIds. The drop callback now expands
to the full selection when the grabbed row is part of it, and the store
gains reorderSidebarEntries() to move them together.
2. Clicking the blank tree area didn't clear the selection (notably in
double-click activation mode). Row clicks now stopPropagation and the
tree containers clear the selection on click, so only blank clicks reset.
3. Creating a group then submitting an empty name dissolved ALL groups.
Enter (@keydown.enter) and the following @blur both fired finishRenameGroup;
the first call rebuilt the tree and recycled props.node onto another group,
so the second deleted the wrong one, cascading. Guard against double
invocation and treat an empty name as a cancel (never delete here — deleting
a group stays in the context menu).
Verified end-to-end on the web build: multi-select drag nests both
connections under the group; blank-click clears selection; empty-name Enter
keeps all groups intact. pnpm check is green.
Co-authored-by: vrustx <vrustx@vrustxdeMac-mini.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
After an app update (typically >15min since last use), the on-disk schema
tree cache is past its TTL and counts as stale. When "locate in sidebar"
loads the connection's databases, the stale cache is served synchronously
and an async `refreshStaleTreeNode` fires in the background; that refresh
replaces the database node with a fresh one whose tables haven't loaded
yet, evicting the node that locate just populated. By the time
`findNodePathForActiveTab` runs, the target table isn't in the tree, so
locate only reaches the database. After a restart the cache is fresh, no
refresh races, and locate works — matching the report.
Make `ensureTreeLoadedForTab` accept `{ force }` (loads everything via
awaited calls, bypassing the stale-cache fire-and-forget path) and, in
`locateActiveTabInSidebar`, retry once with force when the first
`findNodePath` misses. Fresh-cache locates still succeed on the first
pass and never force (no regression); `refreshStaleTreeNode` is untouched.
Co-authored-by: vrustx <vrustx@vrustxdeMac-mini.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
SQLite and DuckDB do not support the `alias(col1, col2)` subquery column
naming syntax, which caused "near '(': syntax error" when sorting query
results on these databases.
The data grid header only showed column names, and column types were
available only via tableMeta (open-table view). Arbitrary query results
(e.g. `select * from pg_depend`) therefore showed no type at all, which
is exactly the case the reporter hit.
Backend: add `column_types` to QueryResult (serde-default, backward
compatible) and populate it for the native drivers where the type is
readily available — PostgreSQL, MySQL, SQL Server, ClickHouse. Other
drivers leave it empty for now (no behavior change); schemaless stores
(Mongo/Redis/ES) have no column types.
Frontend: render a type row under each column name in the grid header,
color-coded by type. The type is resolved from tableMeta first (richer,
includes precision) and falls back to the query result's column_types by
index. Add a `showColumnTypesInHeader` setting (default on) and keep the
msgpack tab-result cache compatible. The source-selection logic is
extracted to lib/dataGridColumnType.ts with unit tests.
Co-authored-by: vrustx <vrustx@vrustxdeMac-mini.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ClickHouse and Databend expect square-bracket array literals (unquoted),
while PostgreSQL/DuckDB/etc. use curly-brace quoted format. Previously
all array values were unconditionally rendered with `'{...}'` syntax,
which produced wrong INSERT/UPDATE statements for ClickHouse columns
of nested array types like `Array(Array(Point))`.
The sidebar already supports multi-select, so deletion now resolves the context-clicked selected connection set before confirming. Connection removal gained a batched path to persist once while pruning sidebar layout, pins, active state, connection errors, and stale selection for every removed connection.
Constraint: No new dependencies and existing single-connection delete behavior must remain available.\nRejected: Delete every selected tree item regardless of type | mixed tree selections could unexpectedly remove connections while table/object deletion has separate SQL confirmation behavior.\nConfidence: high\nScope-risk: narrow\nTested: pnpm fmt; pnpm test; pnpm typecheck; pnpm lint; pnpm build\nNot-tested: Manual desktop UI interaction against a running Tauri window
Co-authored-by: caisin <caisin@caisins-Mac-mini.local>
PostgreSQL's internal "char" type (OID 18, e.g. pg_depend.deptype,
pg_shdepend.deptype) is a single byte the driver decodes as i8. In
pg_value_to_json it had no dedicated branch and fell through to the i8
arm below, surfacing the raw ASCII code (110 for 'n') instead of the
character.
Add a "char" branch that renders the byte as its character (matching
psql's charout): a zero byte becomes an empty string, any other byte is
interpreted as a Latin-1 code point so the output is always valid UTF-8
and never panics. SQL standard CHAR(n)/character(n) is a different type
("bpchar") and is unaffected. Added a unit test.
Co-authored-by: vrustx <vrustx@vrustxdeMac-mini.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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>
The bottom-docked cell detail side panel could not be resized and its
details view still used the old three-block "value / raw value / formatted
JSON" layout, causing the issues reported on macOS:
- bottom layout had no resize handle and a fixed, too-small height
- "value" showed the grid's (truncated) display value while "raw value"
showed the original — redundant for JSON, and shown inconsistently
(only when the two happened to differ)
- the "formatted value" block rendered the grid-truncated display value,
which is incomplete and confusing inside the detail view
Changes:
- side panel bottom layout: add a top-edge row-resize handle and make the
height adjustable (reuse clampCellDetailPanelSize, support vertical drag)
- unify the side panel details view with the cell-detail dialog: a single
value area showing the original value plus a "format JSON" toggle button
- drop the redundant "raw value" / "formatted value" blocks in both the
side panel and the dialog (the dialog change also addresses the #528
follow-up where the truncated "formatted value" block was confusing)
Co-authored-by: vrustx <vrustx@vrustxdeMac-mini.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
When app restarts, table data shows "data unavailable" but Mod+R didn't
work because the DataGrid component wasn't mounted. Fixed by handling
the reload emit directly in handleModRTarget. Also added kbd-styled
shortcut hint (⌘R / Ctrl+R) on the data-unavailable placeholder.
When Chinese text (table data or column comments) was written to MySQL
through a connection using the wrong charset (e.g. latin1/CP1252),
each byte of the correct UTF-8 representation was stored as a separate
CP1252 character, then re-encoded as UTF-8 on read, resulting in
garbled display like "主é"®" instead of "主键".
This commit adds a `fix_potential_double_encoding` function that reverses
the CP1252→UTF-8 double-encoding at read time, with a safety check that
only applies the fix when the decoded result contains CJK characters,
avoiding any impact on legitimate Latin-1 or ASCII text.
Changes:
- Add fix_potential_double_encoding() helper with full CP1252 mapping
for the 0x80-0x9F range (€, ", ", etc.)
- Apply fix in mysql_value_to_json() to cover all table data display
- Apply fix in get_columns() to cover column comments via
information_schema.COLUMNS
- Apply fix in get_columns_show() to cover column comments via
SHOW FULL COLUMNS (fallback path)
- Minor formatting: break long line in columns_sql()
Address the follow-up UI feedback on the data detail dialogs:
- cell detail: toggle between raw value and formatted JSON inside a single
value area (via a "format JSON" button) instead of stacking the value,
formatted value and formatted JSON blocks, removing the redundancy.
- kill horizontal scrollbars: add break-words to the formatted-value block,
and constrain row/column detail value columns with w-full max-w-0 so long
unbroken values wrap instead of overflowing the table.
- row detail: column name uses break-words instead of break-all to stop long
names from wrapping character-by-character.
- unify footer button layout across the three detail dialogs (bulk-copy
actions on the left, copy-name on the right).
- add a search box to row & column detail to filter fields by name / value /
row number (filterDataGridDetailFields + unit tests).
- i18n: add detailSearchPlaceholder / detailSearchNoMatch for all 6 locales.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Database connection context menus now show a copy action when the connection has enabled transport layers. The action starts or reuses the ordered transport chain, copies the final local forwarding port, and keeps runtime config cached so later disconnect cleanup can stop the created tunnel.
Constraint: Local testing sometimes needs external tools to connect through DBX's generated proxy/tunnel endpoint
Rejected: Copy full host:port endpoint | user specifically asked for the port and existing tunnel host is always localhost
Rejected: Require an active pool before copying | local test workflows may need the tunnel before opening the DBX connection
Confidence: high
Scope-risk: moderate
Tested: pnpm test -- packages/app-tests/connectionTransport.test.ts (ran full app-tests: 862 passed)
Tested: pnpm typecheck
Tested: pnpm exec oxlint --vue-plugin apps/desktop/src/components/sidebar/TreeItem.vue apps/desktop/src/lib/connectionTransport.ts apps/desktop/src/lib/api.ts apps/desktop/src/lib/tauri.ts apps/desktop/src/lib/http.ts
Tested: cargo check -p dbx-core -p dbx-web
Tested: cargo check -p dbx
Tested: cargo fmt --check --all
Co-authored-by: caisin <caisin@caisins-Mac-mini.local>
* Preserve ordered SSH and proxy connection layers
Replace separate SSH/proxy connection fields with ordered transport_layers while keeping legacy migration and secret fallback paths intact. The UI now edits SSH tunnel/proxy layers in configured order without a global SSH enable gate.
Constraint: Existing saved SSH tunnels, proxy settings, and secret-store keys must continue to load through migration.
Rejected: Folding proxy fields into SshTunnelConfig | mixes proxy semantics into an SSH-specific structure.
Confidence: high
Scope-risk: moderate
Directive: Keep SSH/proxy structs provider-specific; put cross-layer chaining in transport_layer_tunnel orchestration.
Tested: git diff --check; cargo fmt --check; cargo check --workspace; cargo test -p dbx-core --lib; vue-tsc --noEmit --project apps/desktop/tsconfig.json; tsc -p packages/node-core/tsconfig.json --noEmit; oxlint --vue-plugin apps/desktop/src; tsx --tsconfig apps/desktop/tsconfig.json --test packages/app-tests/*.test.ts; tsx --test packages/node-core/tests/*.test.ts
Not-tested: Live external SSH/proxy/database endpoint integration.
* Keep ordered transport changes CI-format clean
Constraint: CI pnpm check failed only on oxfmt formatting for two desktop TypeScript files
Confidence: high
Scope-risk: narrow
Directive: Keep generated/editor config changes out of this PR fix commit
Tested: PATH="/Volumes/data/code/rust/dbx/node_modules/.bin:/Users/hekx/.codex/tmp/arg0/codex-arg0nuL34n:/Users/hekx/.cargo/bin:/Users/hekx/.local/bin:/opt/homebrew/opt/llvm/bin:/opt/homebrew/opt/libpq/bin:/Volumes/data/Users/hekx/.opencode/bin:/Users/hekx/.bun/bin:/Volumes/data/sdks/flutter/bin:/Volumes/data/Users/hekx/.cargo/bin:/Users/hekx/.local/bin:/opt/homebrew/opt/llvm/bin:/opt/homebrew/opt/libpq/bin:/Volumes/data/Users/hekx/.opencode/bin:/Users/hekx/.bun/bin:/Volumes/data/Users/hekx/Library/pnpm:/Volumes/data/sdks/flutter/bin:/Volumes/data/Users/hekx/.cargo/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/pkg/env/global/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/go/bin:/opt/homebrew/bin:/opt/podman/bin:/Applications/Ghostty.app/Contents/MacOS" rtk node scripts/run-check.mjs
Not-tested: GitHub Actions rerun not observed locally
* Keep Rust checks warning-clean
Constraint: cargo clippy --workspace --all-targets --all-features -- -D warnings failed across core, web, and tauri crates
Rejected: Broad workspace-level clippy suppression | kept allows local to long-argument command/API boundaries
Confidence: high
Scope-risk: moderate
Directive: Preserve src-tauri/tauri.conf.json as an unrelated local change outside this commit
Tested: rtk cargo clippy --workspace --all-targets --all-features -- -D warnings
Not-tested: Full GitHub Actions rerun not observed locally
* Reuse existing proxy tunnels on retry
Proxy tunnel startup now mirrors SSH tunnel behavior by returning the existing local port for an active connection id instead of replacing the managed handle. A second map check aborts a just-spawned duplicate handle if a concurrent retry won the race before insertion, preventing orphaned listeners while keeping the change narrow.
Constraint: Reviewer requested proxy tunnel behavior align with SSH local-port reuse
Rejected: Always overwrite and abort the previous handle | less consistent with SSH behavior and churns listeners during retries
Confidence: high
Scope-risk: narrow
Tested: cargo fmt --check --all
Tested: cargo test -p dbx-core db::proxy_tunnel::tests::start_tunnel_reuses_existing_local_port
Tested: cargo clippy -p dbx-core --all-targets -- -D warnings
---------
Co-authored-by: hekx <hekx@momandeMac-mini.local>
Co-authored-by: caisin <caisin@caisins-Mac-mini.local>
- Fix PostgreSQL function highlighting by disabling doubleDollarQuotedStrings
in extended PostgreSQL dialect, enabling PL/pgSQL syntax highlighting
inside $ blocks
- Add complete custom editor theme system with multi-theme management
(create, rename, duplicate, delete), visual color editor (12 colors),
JSON import/export, real-time preview, and 12 preset color schemes
- Add background/foreground color customization with system theme defaults
- Optimize EditorSettingsDialog layout: 2-column grid with font selector
taking available space and theme dropdown grouped with custom theme button
- Add i18n support for custom theme UI (en, zh-CN, zh-TW, es)
- Fix Tauri production build by adding custom-protocol feature
- Update .gitignore for temporary build artifacts
Closes t8y2#788
Co-authored-by: Sam <14344444@@qq.com>
OpenGauss is based on PostgreSQL 9.2 and does not support WITH ORDINALITY
(PG 9.4+). When the native pg_get_tabledef() path fails, the fallback DDL
builder calls list_indexes() which previously only had two SQL variants, both
using WITH ORDINALITY — causing "syntax error at or near 'WITH'" on OpenGauss.
Add POSTGRES_INDEXES_OPENGAUSS_SQL as a third fallback that uses generate_series
and array_length instead, both available since PG 8.0.