# AI use cases for DBX (t8y2/dbx)

Repo: [t8y2/dbx](https://github.com/t8y2/dbx) | Use cases: 3 | Page: https://dedupedai.com/use-cases/t8y2-dbx/

DBX is a 25 MB cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB and ClickHouse, with consoles for Kafka, RabbitMQ and MQTT. It has a built-in AI SQL assistant that works with Claude, OpenAI or local models via Ollama, schema tools such as ER diagrams and schema diff, and a separate MCP server so coding agents can query the connections you set up in DBX.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Let Claude Code or Cursor query your databases, read only: https://dedupedai.com/use-cases/t8y2-dbx/let-claude-code-query-your-databases-with-the-dbx-mcp-server/
- Write, explain and fix SQL in plain language with the DBX AI assistant: https://dedupedai.com/use-cases/t8y2-dbx/write-and-fix-sql-in-plain-language-with-dbx/
- Compare schemas and move data between databases: https://dedupedai.com/use-cases/t8y2-dbx/compare-schemas-and-migrate-data-between-databases-with-dbx/

## How to let Claude Code or Cursor query your databases, read only with DBX

Repo: [t8y2/dbx](https://github.com/t8y2/dbx) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Add the DBX MCP server to your agent and restrict it to read only on an allowlist of connections.

**Who it is for:** A developer who wants the coding agent to check real schema and data while writing queries and migrations.

**The problem:** Agents guess at schemas, and giving them raw database credentials is risky.

**The outcome:** An agent that queries your DBX connections through MCP with read only access to the connections you allow.

### Steps

1. Install DBX and set up your connections in the app
2. Run `npx @dbx-app/mcp-server` once to check it starts
3. Add the DBX entry to your .mcp.json with command npx and args -y @dbx-app/mcp-server
4. In DBX Settings, MCP, set the connection allowlist and choose Read only
5. Ask the agent to inspect a table's schema and sample rows before writing a query

### Prompt to paste into your agent

```text
Add the t8y2/dbx MCP server to this project's .mcp.json, then use it in read only mode to inspect the <table> schema on <connection> and write a query that <goal>. Do not run any write statements.
```

### Caveat



Risk, database-access: Keep production connections out of the allowlist or on Read only; Full access lets an agent change data.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/t8y2-dbx/let-claude-code-query-your-databases-with-the-dbx-mcp-server/

## How to write, explain and fix SQL in plain language with the DBX AI assistant with DBX

Repo: [t8y2/dbx](https://github.com/t8y2/dbx) | Difficulty: Beginner | Time: 10 minutes | Basis: From the README

Highlight a table, describe what you want, and get SQL that runs through built-in safety checks.

**Who it is for:** An analyst or developer who knows what they need from the data but not the exact SQL.

**The problem:** Copying SQL between a chat window and a database client is slow and error-prone.

**The outcome:** Working SQL generated, explained or fixed inside the editor, checked before it runs.

### Steps

1. Download DBX for macOS, Windows or Linux and connect a database
2. Configure the AI SQL Assistant with Claude, OpenAI or a local model via Ollama
3. Highlight a table and describe the result you want in plain language
4. Ask it to explain or optimize the query, or fix an error message
5. Run it with Cmd+Enter; destructive operations ask for confirmation

### Prompt to paste into your agent

```text
In t8y2/dbx connected to <database>, use the AI SQL Assistant with <provider> to write a query that <goal>, explain it line by line, and optimize it before I run it.
```

### Caveat



Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/t8y2-dbx/write-and-fix-sql-in-plain-language-with-dbx/

## How to compare schemas and move data between databases with DBX

Repo: [t8y2/dbx](https://github.com/t8y2/dbx) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Use schema diff, data compare and data transfer to check and sync two environments.

**Who it is for:** A developer who needs to know how staging differs from production before a release.

**The problem:** Spotting schema drift across environments by reading DDL is tedious and easy to miss.

**The outcome:** A schema diff across two connections, a data comparison, and a data transfer when you choose to sync.

### Steps

1. Connect both databases in DBX, using an SSH tunnel if needed
2. Open Schema diff to compare structures across the two connections
3. Use Data compare to review differences in a table's rows and the synchronization output
4. Use Data transfer to migrate data between databases, or Database export for a full dump first
5. Review the ER diagram of the target to confirm relationships

### Prompt to paste into your agent

```text
Using t8y2/dbx, run a schema diff between <staging> and <production>, summarize every difference, and draft the migration I would need. Export a full dump of the target before suggesting any data transfer.
```

### Caveat



Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/t8y2-dbx/compare-schemas-and-migrate-data-between-databases-with-dbx/
