Skip to content

feat(scripting): add MongoDB support to JavaScript scripting - #101

Merged
oesukam merged 1 commit into
mainfrom
feat/mongo-scripting
Aug 6, 2026
Merged

feat(scripting): add MongoDB support to JavaScript scripting#101
oesukam merged 1 commit into
mainfrom
feat/mongo-scripting

Conversation

@oesukam

@oesukam oesukam commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Extends JS scripting mode to MongoDB connections (previously SQL-only).

How it works

In a Mongo script, db.query(...) takes a mongo-shell command string (db.coll.find({…})) instead of SQL. The Mongo driver's stream() already parses that syntax and streams documents as rows, so the existing ScriptRunner seam works unchanged — only the run_script SQL-only gate needed relaxing to also allow QueryLang::MongoShell.

const active = await db.query('db.users.find({ active: true })');
for (const u of active) console.log(u.name);
return active;

The array result, console strip, ⌘+Enter, and return-value echo all behave exactly as they do for SQL scripting.

Changes

  • Backend: run_script accepts SQL or MongoShell connections.
  • Frontend: scriptingAvailable includes the mongo engine; the JS-in-SQL guard is skipped for Mongo (a shell command isn't a mis-typed script).
  • Test: real-driver integration test runs db.query('db.users.find({…})') through the actual Mongo driver (testcontainer) in a script and iterates the array result.
  • Docs: scripting page now covers MongoDB + the Console strip.

Tests

Mongo real-driver script test passes; fmt/clippy clean; frontend tsc + lint (0 errors) + 276 unit tests green.

Completes the MongoDB scripting task from the scripting-mode roadmap.

Extend db.query scripting to MongoDB connections. In a Mongo script,
db.query(...) takes a mongo-shell command string (db.coll.find({…})) instead
of SQL — the driver's stream() already parses that syntax, so the existing
ScriptRunner seam works unchanged; only the run_script SQL-only gate needed
relaxing to also allow QueryLang::MongoShell.

- Backend: run_script accepts SQL or MongoShell connections.
- Frontend: scriptingAvailable includes the mongo engine; the JS-in-SQL-mode
  guard is skipped for Mongo (a shell command isn't a mis-typed script).
- Test: real-driver integration test runs db.query('db.users.find({…})')
  through the actual Mongo driver in a script and iterates the array result.
- Docs: scripting page now covers MongoDB + the Console strip.
@oesukam oesukam changed the title feat(scripting): JavaScript scripting on MongoDB feat(scripting): add MongoDB support to JavaScript scripting Aug 6, 2026
@oesukam
oesukam merged commit 531320c into main Aug 6, 2026
7 of 8 checks passed
@oesukam
oesukam deleted the feat/mongo-scripting branch August 6, 2026 06:35
@oesukam oesukam mentioned this pull request Aug 6, 2026
oesukam added a commit that referenced this pull request Aug 6, 2026
Version bump for the **v0.4.0** release: `0.3.0 → 0.4.0` in
`tauri.conf.json`, `Cargo.toml`, and `Cargo.lock`.

## What's in v0.4.0 (since v0.3.0)

**Features**
- MongoDB support: JS scripting, table-data browse/edit/insert/delete,
connection URL, TLS handling (#101, #103, #105)
- Engine registry — per-engine metadata drives the connection form,
queries, display (#103)
- Rail sessions behave like tabs: click selects, right-click to close,
dim inactive, reconnect on click (#104)
- Row count + query timer moved to a footer below the grid, for both
table-data and SQL tabs (#108, #109)

**Fixes**
- Grid fills the pane for few-column tables; no open blink (#106)
- Edit-connection opens the real connection; Mongo honors its pinned
database (#107)
- Startup white-flash eliminated (dark window bg + pre-render tab
hydration) (#110)
- Mongo defaults to TLS-off so a local Mongo connects (#105)
- Actionable commitlint PR-title error (#102); release gated on
lint/typecheck/tests (#100)

## Gate

lint (0 errors), typecheck (CI-style clean), 321 unit tests, frontend
build — all green locally.

After merge, the Release workflow is triggered with `publish=false` to
produce a **draft** release for review.
oesukam added a commit that referenced this pull request Aug 22, 2026
Version bump for the **v0.4.0** release: `0.3.0 → 0.4.0` in
`tauri.conf.json`, `Cargo.toml`, and `Cargo.lock`.

## What's in v0.4.0 (since v0.3.0)

**Features**
- MongoDB support: JS scripting, table-data browse/edit/insert/delete,
connection URL, TLS handling (#101, #103, #105)
- Engine registry — per-engine metadata drives the connection form,
queries, display (#103)
- Rail sessions behave like tabs: click selects, right-click to close,
dim inactive, reconnect on click (#104)
- Row count + query timer moved to a footer below the grid, for both
table-data and SQL tabs (#108, #109)

**Fixes**
- Grid fills the pane for few-column tables; no open blink (#106)
- Edit-connection opens the real connection; Mongo honors its pinned
database (#107)
- Startup white-flash eliminated (dark window bg + pre-render tab
hydration) (#110)
- Mongo defaults to TLS-off so a local Mongo connects (#105)
- Actionable commitlint PR-title error (#102); release gated on
lint/typecheck/tests (#100)

## Gate

lint (0 errors), typecheck (CI-style clean), 321 unit tests, frontend
build — all green locally.

After merge, the Release workflow is triggered with `publish=false` to
produce a **draft** release for review.
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