Skip to content

Fix database UI query issues - #613

Open
DhruvShah-Dev wants to merge 2 commits into
TabularisDB:mainfrom
DhruvShah-Dev:fix/database-ui-query-fixes
Open

Fix database UI query issues#613
DhruvShah-Dev wants to merge 2 commits into
TabularisDB:mainfrom
DhruvShah-Dev:fix/database-ui-query-fixes

Conversation

@DhruvShah-Dev

@DhruvShah-Dev DhruvShah-Dev commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Use the live selected database list in the object palette and align its multi-database branch with the sidebar.
  • Make query error text selectable and add an explicit copy action.
  • Render MySQL/MariaDB JSON update values as JSON text instead of CAST(... AS JSON), which MariaDB rejects.

Closes #591.
Closes #608.
Closes #610.

Validation

  • pnpm.cmd vitest run tests/components/modals/ErrorModal.test.tsx tests/utils/quickNavigator.test.ts
  • pnpm.cmd typecheck
  • pnpm.cmd lint
  • pnpm.cmd build
  • git diff --check
  • cargo test mysql_json_update_value --manifest-path src-tauri/Cargo.toml --lib --no-run
  • GitHub CI test job passed

@DhruvShah-Dev
DhruvShah-Dev force-pushed the fix/database-ui-query-fixes branch from 23b4526 to ba58c90 Compare August 8, 2026 23:43
@kilo-code-bot

kilo-code-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (5 files)
  • src-tauri/src/drivers/mysql/mod.rs
  • src-tauri/src/drivers/mysql/tests.rs
  • src/components/modals/ErrorModal.tsx
  • src/components/modals/QuickNavigatorModal.tsx
  • tests/components/modals/ErrorModal.test.tsx

Reviewed by step-3.7-flash · Input: 84.7K · Output: 23.1K · Cached: 2.2M

@debba debba left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hey @DhruvShah-Dev, thanks for this one! I did a deep local review: ran your tests on the branch and spun up real MariaDB 11 and MySQL 8.4 containers to verify the JSON fix. Here's where I landed.

The good news: the MariaDB JSON fix is solid. Verified against real databases:

  • the old shape SET col = CAST('{"ok":true}' AS JSON) fails on MariaDB 11 with error 1064, which is exactly the bug in #610
  • the new plain-string shape works on MariaDB for both TEXT and JSON columns, and on MySQL 8.4 the value stays typed JSON (JSON_TYPE = OBJECT)
  • MySQL still rejects invalid JSON server-side (error 3140), so dropping the CAST doesn't lose any validation

Both new Rust tests pass on your branch, and extracting push_mysql_update_value matches the existing push_pk_condition pattern in mod.rs. This part is merge-ready as far as I'm concerned.

The problem: the branch is now conflicting with main. The command palette refactors merged on Aug 10 (778b5cc, ff51644) deleted QuickNavigatorModal.tsx entirely. The bug you're fixing in #591 is still real on current main, but it now lives in src/hooks/useCommandPaletteObjectItems.ts (around line 95), which still derives configuredDatabases from getDatabaseList(connection?.params.database) instead of the live selection. So that part needs to be reimplemented in the new hook rather than mechanically rebased. Heads up: the hook is per-connection via connectionDataMap, while selectedDatabases in DatabaseProvider tracks the active connection only, so it's not a one-to-one port.

About #608: the issue is about the error text in the query result panel, which is rendered by src/components/ui/ErrorDisplay.tsx. That component is untouched here and is still unselectable (we have a global user-select: none in index.css). ErrorModal.tsx is actually dead code right now: its only mount in Editor.tsx has an isOpen state that nothing ever sets to true, on your branch as well as on main. Also note we already shipped copy + selectable text in AlertModal via #618. So the right home for the #608 fix is ErrorDisplay.tsx.

Minor nit: the copy button uses dataGrid.copied, but since #618 we have common.copied in every locale, better to use that one for consistency.

My suggestion: split this PR in three.

  1. The Rust JSON fix + tests as a standalone PR, that one can go in quickly.
  2. The #591 fix reimplemented in useCommandPaletteObjectItems.ts on top of current main.
  3. The #608 fix moved to ErrorDisplay.tsx (and ErrorModal.tsx could probably just be deleted as dead code while you're at it).

Thanks again for digging into these!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants