# NEXUS AI Database Intelligence

The database intelligence layer connects external PostgreSQL or MySQL sources that are separate from databases provisioned with a deployment.

## Capabilities

- Connect, test, list, and remove external database sources.
- Inspect a normalized schema graph of tables, columns, types, constraints, and indexes.
- Preview queries with an execution plan and safety analysis.
- Execute confirmed queries with sandboxing, statement timeouts, and row caps.
- Propose a schema fix from deployment log errors.
- Apply a reviewed fix proposal with audit logging.

## Safety

External database credentials are encrypted at rest. Treat DML and DDL as high-risk. Agents should call query preview first, show the proposed change, and require explicit confirmation before execution. Applying an AI-proposed fix also requires explicit authorization.

## MCP tools

The tools are `nexusai_db_source_list`, `nexusai_db_source_connect`, `nexusai_db_source_delete`, `nexusai_db_inspect_schema`, `nexusai_db_query_preview`, `nexusai_db_query_execute`, `nexusai_db_propose_fix`, and `nexusai_db_apply_fix`.

## Related resources

- [Databases](/docs/databases.md)
- [Backups](/docs/backups.md)
- [Security](/docs/security.md)
- [MCP tools](/mcp/tools.json)
