Skip to content

Add MongoDB workbench support - #155

Open
amalshaji wants to merge 25 commits into
mainfrom
codex/mongodb-support
Open

Add MongoDB workbench support#155
amalshaji wants to merge 25 commits into
mainfrom
codex/mongodb-support

Conversation

@amalshaji

@amalshaji amalshaji commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • add URI-native MongoDB connections with catalog browsing, document CRUD, find and aggregate queries, collection/index/validator administration, saved queries, and history
  • polish the MongoDB workbench with compact segmented navigation, themed JSON editors, aligned small switches, shared selects, and app-native create/delete dialogs
  • fix saved/history query replay so loading a query does not execute it or create a duplicate history entry
  • add MongoDB-aware AI query generation as a streamed, validated, read-only draft that is never executed without explicit review and Run
  • make collection creation visibly select and load the new collection
  • integrate MongoDB with managed Docker databases, read-only MCP tools, import/export, lifecycle handling, and MongoDB 7/8 driver coverage
  • use MongoDB 7 for managed containers so they run on Linux kernels affected by the MongoDB 8/TCMalloc incompatibility
  • centralize connection capabilities and typed MongoDB query/API boundaries
  • decompose the frontend workbench and Rust driver into focused modules
  • persist managed MongoDB runtime ports and connection URIs atomically
  • preserve latest-main idle pool eviction, request ordering, SSH key passphrase, and dependency fixes

Why

MongoDB is document-oriented and does not fit DBcooper's relational DatabaseDriver and schema workspace. This introduces an explicit document-database path while keeping SQL, Redis, and file-database behavior isolated.

The workbench follows a compact document-tool layout: database catalog, bounded query composer, results list, and document inspector. Mongo green is reserved for selection and AI-draft accents rather than replacing the existing application palette.

Migration note

Migration 010 removes the Docker engine allowlist. SQLite cannot drop an existing CHECK constraint in place, so the migration safely rebuilds docker_connections and copies its rows. Rewriting migration 009 would invalidate SQLx checksums for users who already ran a canary containing it.

Validation

On the current head:

  • bun run check — 170 tests, TypeScript checks, ESLint, and production build
  • cargo fmt --check
  • cargo test --lib -- --test-threads=1 — 127 passed, 1 intentionally ignored
  • focused Mongo history, create-collection, UI-control, AI-draft, and prompt regression tests
  • exact Tauri dev process verified running from /private/tmp/dbcooper-mongodb-support/src-tauri
  • app-data integration suite — 25 passed
  • managed mongo:7.0 container started on OrbStack Linux 7.0.11 and passed DBcooper's exact mongosh readiness probe
  • five-axis code-quality review covering correctness, readability, architecture, security, and performance

The current all-target Rust run passed unit and app-data tests, then reached the ClickHouse integration target without a local ClickHouse service. CI supplies the Docker-backed PostgreSQL, Redis, and ClickHouse services.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 28, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
dbcooper 7e231d7 Commit Preview URL

Branch Preview URL
Aug 05 2026, 01:18 PM

@amalshaji
amalshaji force-pushed the codex/mongodb-support branch from 7cf1166 to 60d2aaf Compare July 28, 2026 10:25
amalshaji added 15 commits July 28, 2026 16:11
Loading saved or historical queries now restores editor state without re-running and duplicating history. Newly created collections are selected immediately so the action has an observable result.
Generate validated read-only MongoDB query specifications as reviewable drafts, never automatic executions. The workspace now uses compact segmented navigation and app-native collection dialogs.
Use the shared JSON editor theme across queries, validators, and documents. Replace native selects and confirms with compact design-system controls and align index options and actions.
Bound fill-height document and validator editors to the available flex space so CodeMirror owns vertical overflow instead of being clipped by the inspector.
Comment thread src/hooks/connection-details/useMongoWorkbench.ts
Comment thread src/components/ConnectionForm.tsx Outdated
Comment thread src-tauri/src/docker/service.rs Outdated
@amalshaji
amalshaji marked this pull request as ready for review August 5, 2026 08:35
Comment thread src-tauri/src/database/mongodb/query.rs Outdated
Comment thread src-tauri/src/docker/service.rs
Comment thread src/components/connection-details/MongoDocumentBrowser.tsx Outdated
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.

1 participant