DB Manager — User Guide | YoBench
How to use the DB Manager module in YoBench: MySQL, PostgreSQL, MongoDB, SQLite and MS SQL, ER diagrams, SQL editor with AI, schema compare, scheduled backups.
What the DB Manager module does
DB Manager is a unified workbench for working with relational and document databases directly from YoBench. Instead of juggling several tools (DBeaver, pgAdmin, mysql-cli, MongoDB Compass) you connect from one app, browse the schema, run queries, generate SQL with AI, compare schemas, run scheduled backups and monitor connection health.
What you get:
- Six database engines — MySQL, MariaDB, PostgreSQL, SQLite, MS SQL Server, MongoDB.
- Schema explorer — full tree of databases / schemas / tables / views / procedures with structure, indexes, foreign keys and triggers.
- SQL editor with query history, result export to CSV / JSON / XLSX and a 10 000-row safety cap.
- AI SQL generation — describe what you need in natural language, get a draft query bound to the current database context.
- ER diagram with automatic Dagre layout, foreign-key edges and zoom / pan.
- Schema compare and sync — diff two schemas, generate
ALTERscript, apply it to the target. - Backups — manual dump / restore plus a scheduler with cron, file rotation and run history.
- Connection monitoring — health checks, latency, version banner.
- Encrypted secrets — passwords, SSL keys and SSH keys are stored encrypted in the local DB; the renderer only sees
has_passwordflags.
Supported engines and connection options
| Engine | Default port | Notes |
|---|---|---|
| MySQL | 3306 | TCP/IP, optional SSL |
| MariaDB | 3306 | Same protocol family as MySQL |
| PostgreSQL | 5432 | SSL modes: disable, require, verify-ca, verify-full |
| MS SQL Server | 1433 | TCP/IP |
| MongoDB | 27017 | authSource parameter for authentication database |
| SQLite | — | Local file, no host or port |
For TCP-based engines you can store SSH-tunnel credentials in the connection record (the field is reserved for future UI exposure). All sensitive fields — password, SSL key, SSH password, SSH private key — are encrypted at rest.
Workbench
Each opened connection lives in its own tab. A single window can have up to 10 active sessions (renderer-bound). Headless sessions used by the scheduler, backups and health checks run in a separate pool.
The Workbench has:
- Schema tree on the left — drill from connection root down to a single table or view.
- Object inspector — columns with types and nullability, indexes (incl. uniqueness), constraints, foreign keys and triggers.
- Data view — paginated rows with column-level filters. Cells are capped at 64 KB; the result set returns a
truncatedflag if the row count exceeds 10 000. - SQL editor — write or paste a query, run it, view tabular results, jump back through query history.
- DDL view — full
CREATEscript for the selected table or for the whole database. - ER diagram — interactive React Flow canvas with Dagre auto-layout for tables and FK edges.
SQL editor and AI generation
The SQL editor accepts arbitrary statements for the connected engine. Results land in a sortable table that supports per-column filters and three export formats: CSV, JSON and XLSX. Every executed query is stored in Query History for the connection so you can re-run or copy it later.
AI SQL generation is available when an AI provider is configured under Settings → DB Manager:
- Open the AI input field above the editor.
- Describe what you want (e.g. "top 10 customers by revenue in the last 30 days").
- The current database / schema is sent as context, the AI returns a draft query, you review and execute it.
If no provider is selected the AI button stays disabled — querying continues to work, only the generation step is unavailable.
Schema compare and sync
Pick two schemas (from the same connection or two different ones), run Schema Compare and review the diff:
- Tables:
added,removed,altered,identical. - For altered tables: column-level changes (added / removed columns, type changes, default / nullability changes, index changes).
- Generated sync script — an executable
ALTER/CREATE/DROPsequence that brings target up to source. - Optional export of the script to disk before running it.
Use it for two typical jobs: promoting changes from staging to production and validating that two replicas drifted apart.
Backup and restore
One-shot dump. Right-click a connection → Backup. The dump is written to a ZIP archive that includes a JSON manifest plus the database payload. You can include or exclude:
- Data rows
- Views, stored procedures, functions
- Grants
Restore. Open a target connection (or create a new one for an empty database) → Restore → pick a dump archive → confirm overwrite policy.
Scheduled backups. From a connection's Backup Schedules panel:
- Pick a cron expression or a preset (every day, every week, every Nth hour).
- Choose a destination folder.
- Set rotation: keep N newest archives.
- Optional Run Now button to validate the schedule without waiting.
The Backup History panel shows every run with status, archive size and duration. Failed runs include the error string.
Connection monitoring
Every connection has an optional monitoring flag with an interval (default 5 minutes). When enabled the Workbench:
- Pings the server with the engine-specific liveness check.
- Records latency in milliseconds.
- Stores the latest server version banner.
- Shows a status indicator on the connection row in the list.
The history is stored locally and feeds the Monitoring panel in the Workbench tab.
Embedded DB tasks
Each connection can host its own DB tasks — periodic SQL scripts (cleanup, materialised view refresh, statistics). A task has:
- A name and the SQL body.
- A schedule (cron-style).
- An enabled / disabled toggle.
- Run history with status:
success,error,timeout.
DB tasks are different from the AI Task Scheduler: they are pure SQL, single-connection, no AI involved.
Settings
Under Settings → DB Manager:
- AI provider — which provider answers the AI SQL prompt. Empty by default.
Per-connection settings live in the connection form: name, engine, host, port, database, user, password, SSL mode, SQLite file path, monitoring interval and engine-specific extras (e.g. MongoDB authSource).
Workflow
1. Add a connection
- Open DB Manager from the sidebar.
- Connections tab → New connection.
- Pick the engine — the form changes to show only the relevant fields.
- Fill in host / port / database / user / password (or file path for SQLite).
- Click Test — you see the server version and round-trip latency.
- Save.
2. Open the workbench
- Click Open on a connection row → a new tab opens.
- Browse the schema tree, double-click a table to inspect data and structure.
- Switch to SQL Editor to run statements.
3. Schedule backups
- From the connection menu pick Backup Schedules.
- New Schedule → folder, cron expression, retention.
- Run Now to verify, or wait for the cron tick.
- Inspect runs under Backup History.
4. Compare schemas
- From the connection menu pick Schema Compare.
- Select source and target (database + schema).
- Compare → review the diff.
- Generate Sync Script → review SQL → Execute or Save to file.
Next steps
- Configure an AI provider to enable AI SQL generation.
- Use the AI Task Scheduler when you need an LLM to run a query, summarise the result and post it somewhere on a cron schedule.
- For load and capacity testing of the database itself, the Load Testing module can drive HTTP endpoints in front of it.
Help and feedback
Found a bug or want a new engine supported? Contact us via the feedback form.