Vite default 5173 frequently conflicts with parallel local projects.
Move Tusk's vite dev server (and tauri devUrl) to 5174 so it can
coexist with another project running on the default port.
Removes enterprise/DBA features and replaces the marginal AI bar with a
central chat agent that has progressive-discovery tools, cross-session
memory, saved-query reuse, and inline result actions. Adds ClickHouse
support alongside PostgreSQL/Greenplum.
Cleanup
- Drop ~10k LOC of advanced features: Docker, Snapshots, Validation,
Index Advisor, Role/User Management, Data Generator, ERD, Lookup.
- Trim deps: drop @xyflow/react, dagre, @types/dagre; cut tokio features
to rt-multi-thread/sync/time/net/macros.
- Remove unused TuskError variants and dead helpers (topological_sort,
invalidate_schema_cache).
Multi-DB (PostgreSQL + ClickHouse)
- New src-tauri/src/db/ module: ChClient (HTTP-based, reuses reqwest),
sql_guard (cross-flavor read-only whitelist with 8 tests).
- ConnectionConfig gains db_flavor and secure fields with serde defaults
for backwards-compatible connections.json.
- All connection/query/schema/data commands dispatch by flavor; CH
covers connect, execute_query, list_databases/schemas/tables/views/
columns/completion_schema, paginated table fetch.
- Frontend: dbCapabilities matrix, ConnectionDialog engine selector
with port auto-swap and HTTPS toggle, SqlEditor switches to
StandardSQL dialect for CH, TableDataView surfaces CH connections as
read-only.
AI-first chat agent
- New src/components/chat/ panel with composer, message rendering,
collapsible tool-call/result blocks, top-level ErrorBoundary.
- Backend agent loop in commands/chat.rs with strict-JSON tool
protocol. Nine tools: list_databases, list_tables, get_columns,
switch_database, run_query, remember, save_query, find_queries, final.
Forgiving parser accepts both flat and nested-input shapes.
- Compressed history: only the last 4 run_query results carry sample
rows (≤10, cells truncated to 200 chars) into LLM context; older
results marked omitted.
- System prompt uses lite OVERVIEW (DB list + active-DB tables only)
instead of full DDL — schema details are loaded on demand via
get_columns. CH OVERVIEW shows cross-DB tables since CH allows
db.table queries.
Cross-session memory (F1)
- Per-connection markdown file at app_data_dir/memory/<connection_id>.md,
16KB cap with oldest-block eviction. Agent appends via remember()
tool; the file is injected into LEARNED NOTES section of every system
prompt.
- New Memory sidebar tab with editable textarea, badge for note count,
empty-state with template. Edits picked up on the next agent turn.
Saved-query reuse (F2)
- Tools save_query and find_queries scoped to current connection.
save_query attaches a UUID + timestamp; find_queries returns top 10
matches with SQL preview ≤500 chars.
- Storage shared with the sidebar Saved panel.
Inline result actions (F3)
- run_query result block in chat gets Open-full (90vw × 80vh modal with
full ResultsTable, no row cap) and Export (reuses ExportDialog for
CSV/JSON via existing exportCsv/exportJson commands).
Verification
- cargo check clean, zero warnings.
- cargo test --lib: 50 pass (20 chat parser + 4 memory + 8 sql_guard +
6 clean_sql + 12 escape_ident).
- npx tsc --noEmit clean.
- npx vitest run: 20 pass.
- Make reqwest::Client a LazyLock singleton instead of per-call allocation
- Parallelize 3 independent DB queries in get_index_advisor_report with tokio::join!
- Eliminate per-iteration Vec allocation in snapshot FK dependency loop
- Hoist try_local_pg_dump() call in SampleData clone mode to avoid double execution
- Evict stale schema cache entries on write to prevent unbounded memory growth
- Remove unused ValidationReport struct and config_path field
- Rename IndexRecommendationType variants to remove redundant suffix
Reformat Rust code with rustfmt, suppress clippy::too_many_arguments
for Tauri IPC commands, derive Default for AppSettings, fix unused
variable pattern in TableDataView, and add unit tests for utils.
Replace install -D with mkdir -p + install for macOS portability,
add vitest with jsdom and testing-library, configure eslint for
react-hooks v7 warnings, and add tokio test deps for Rust.
- Add macOS Intel build (macos-13 / x86_64-apple-darwin) to CI matrix
- Add artifact upload step to CI build job
- Add release workflow triggered by v* tags with draft GitHub Release
- Add AppImage to Linux bundle targets
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When creating/restoring snapshots with 4+ tables, the progress percentage
calculation overflowed u8 (e.g. 4*80=320 > 255), causing a panic that left
the IPC call unresolved. Also deduplicate fetch_foreign_keys_raw call.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Four new killer features leveraging AI (Ollama) and PostgreSQL internals:
- Data Validation: describe quality rules in natural language, AI generates
SQL to find violations, run with pass/fail results and sample violations
- Test Data Generator: right-click table to generate realistic FK-aware test
data with AI, preview before inserting in a transaction
- Index Advisor: analyze pg_stat tables + AI recommendations for CREATE/DROP
INDEX with one-click apply
- Data Snapshots: export selected tables to JSON (FK-ordered), restore from
file with optional truncate in a transaction
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix SQL injection in data.rs by wrapping get_table_data in READ ONLY transaction
- Fix SQL injection in docker.rs CREATE DATABASE via escape_ident
- Fix command injection in docker.rs by validating pg_version/container_name
and escaping shell-interpolated values
- Fix UTF-8 panic on stderr truncation with char_indices
- Wrap delete_rows in a transaction for atomicity
- Replace .expect() with proper error propagation in lib.rs
- Cache AI settings in AppState to avoid repeated disk reads
- Cap JSONB column discovery at 50 to prevent unbounded queries
- Fix ERD colorMode to respect system theme via useTheme()
- Extract AppState::get_pool() replacing ~19 inline pool patterns
- Extract shared AiSettingsFields component (DRY popover + sheet)
- Make get_connections_path pub(crate) and reuse from docker.rs
- Deduplicate check_docker by delegating to check_docker_internal
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a table has no PRIMARY KEY, use PostgreSQL's ctid (physical row ID)
to identify rows for UPDATE/DELETE operations instead of blocking edits.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add AppSettingsSheet (gear icon in Toolbar) with MCP, Docker, and AI sections
- MCP Server: toggle on/off, port config, status badge, endpoint URL with copy
- Docker: local/remote daemon selector with remote URL input
- AI: moved Ollama settings into the unified sheet
- MCP status probes actual TCP port for reliable running detection
- Docker commands respect configurable docker host (-H flag) for remote daemons
- MCP server supports graceful shutdown via tokio watch channel
- Settings persisted to app_settings.json alongside existing config files
- StatusBar shows MCP indicator (green/gray dot) with tooltip
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use bash with pipefail instead of sh to detect pg_dump failures in pipes
- Switch full clone from binary format (pg_dump -Fc | pg_restore) to plain
text (pg_dump | psql) for reliable transfer through docker exec
- Add --no-owner --no-acl flags to avoid errors from missing roles
- Extract shared run_pipe_cmd helper with proper error handling
- Remove shell commands from progress events to prevent credential leaks
- Fix process log layout overflow with break-all and block-level details
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Clone any database to a local Docker PostgreSQL container with schema
and/or data transfer via pg_dump. Supports three modes: schema only,
full clone, and sample data. Includes container lifecycle management
(start/stop/remove) in the Admin panel, progress tracking with
collapsible process log, and automatic connection creation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add interactive ER diagram with ReactFlow + dagre auto-layout, accessible
via right-click context menu on schema nodes in the sidebar
- Enhance TableStructure: column comments, FK referenced table/columns,
ON UPDATE/DELETE rules, new Triggers tab
- Backend: rewrite get_table_constraints using pg_constraint for proper
composite FK support, add get_table_triggers and get_schema_erd commands
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace Radix ScrollArea with plain overflow-auto div to allow nested
horizontal scrolling in lookup result tables. Add overflow-auto to
table containers. Increase per-database search timeout from 30s to 120s.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract shared call_ollama_chat helper from generate_sql to reuse
settings loading and Ollama API call logic. Add two new AI commands:
- explain_sql: explains what a SQL query does in plain language
- fix_sql_error: suggests corrected SQL based on the error and schema
UI additions: "AI Explain" toolbar button, "Explain" and "Fix with AI"
action buttons on query errors, inline explanation display in results.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Greenplum 7 (PG12-based) compatibility:
- Auto-detect GP via version() string, store DbFlavor per connection
- connect returns ConnectResult with version + flavor
- Fix pg_total_relation_size to use c.oid (universal, safer on both PG/GP)
- Branch is_identity column query for GP (lacks the column)
- Branch list_sessions wait_event fields for GP
- Exclude gp_toolkit schema in schema listing, completion, lookup, AI context
- Smart StatusBar version display: GP shows "GP 7.0.0 (PG 12.4)"
- Fix connection list spinner showing on all cards during connect
AI SQL generation (Ollama):
- Add AI settings, model selection, and generate_sql command
- Frontend AI panel with prompt input and SQL output
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enables searching for a specific column value (e.g. carrier_id=123) across all databases on a PostgreSQL server. The backend creates temporary connection pools per database (semaphore-limited to 5), queries information_schema for matching columns, and executes read-only SELECTs with real-time progress events. Results are grouped by database/table in a new "Entity Lookup" tab.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tokio::spawn panics in .setup() because Tauri's Tokio reactor isn't
active yet at that point. tauri::async_runtime::spawn handles this.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add an MCP (Model Context Protocol) server that starts on 127.0.0.1:9427
at app launch, sharing connection pools with the Tauri IPC layer. This
lets Claude (or any MCP client) query PostgreSQL through Tusk's existing
connections.
MCP tools: list_connections, execute_query, list_schemas, list_tables,
describe_table.
Also add a Makefile with targets for dev, build (cross-platform),
install/uninstall, lint, and formatting.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Column sort by header click in table view (ASC/DESC/none cycle, server-side)
- SQL formatter with Format button and Shift+Alt+F keybinding (sql-formatter)
- Table size and row count display in schema tree via pg_class
- Insert row dialog with column type hints and auto-skip for identity columns
- Saved queries (bookmarks) with CRUD backend, sidebar panel, and save dialog
- Active sessions monitor (pg_stat_activity) with auto-refresh, cancel & terminate
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Admin sidebar tab with database/role management panels, role manager
workspace tab, and privilege dialogs. Backend provides 10 new Tauri
commands for CRUD on databases, roles, and privileges with read-only
mode enforcement. Context menus on schema tree nodes allow dropping
databases and viewing/granting table privileges.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Visual badges help distinguish environments across the UI to prevent
running dangerous queries on production. Environment color takes
priority over custom connection color for the toolbar border.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add four developer/QA features:
- Connection color coding: color picker in dialog, colored indicators across toolbar, tabs, status bar, and connection selectors
- Query history: Rust backend with JSON file storage (500 entry cap), sidebar panel with search/clear, auto-recording from workspace
- Schema-aware SQL autocomplete: backend fetches column metadata, CodeMirror receives schema namespace with public tables unprefixed
- EXPLAIN ANALYZE visualizer: recursive tree view with cost-colored bars, expand/collapse nodes, buffers info, Results/Explain tab toggle
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Connections default to read-only. SQL editor wraps queries in a
read-only transaction so PostgreSQL rejects mutations. Data mutation
commands (update_row, insert_row, delete_rows) are blocked at the
Rust layer. Toolbar toggle with confirmation dialog lets users
switch to read-write. Badges shown in workspace, table viewer, and
status bar.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Rust backend: AppState with connection pool management,
TuskError handling, ConnectionConfig model, and all commands
for connections, schema browsing, query execution, data CRUD,
and CSV/JSON export via sqlx.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>