Skip to main content
Glama
LiteDB desktop

LiteDB desktop

README.md
# LiteDB

A desktop database client for SQLite, PostgreSQL and MySQL that lets AI agents
in without letting them loose. When Claude Code, Cursor or any MCP agent wants to
change your data, LiteDB shows you the statement, the exact row count and the
rows it changes, and nothing runs until you click **Approve**. Every change,
an agent's or your own, can be undone from the audit log.

It is also an everyday client: a real SQL editor with Text to SQL, inline
editing, saved connections, SSH tunnels and production tags.

<div align="center">

[![Download for macOS](https://img.shields.io/badge/macOS-Download-111111?style=for-the-badge&logo=apple)](https://github.com/createdbyadham/LiteDB/releases/tag/v2.9.0)
[![Download for Windows](https://img.shields.io/badge/Windows-Download-0078D4?style=for-the-badge&logo=windows)](https://github.com/createdbyadham/LiteDB/releases/tag/v2.9.0)
[![Download for Linux](https://img.shields.io/badge/Linux-Download-E95420?style=for-the-badge&logo=linux&logoColor=white)](https://github.com/createdbyadham/LiteDB/releases/tag/v2.9.0)

</div>

![Claude Code asks to change 13 customers; LiteDB shows the rows and waits for Approve, the audit log names the agent, and Undo puts the rows back](./docs/assets/demo.gif)

Claude Code asks to move 13 customers from FR to DE. LiteDB shows exactly which
rows and waits; after Approve, the audit log names the agent, and one click puts
the rows back. ([Video version](./docs/assets/demo.mp4).)

If this would make you trust an agent with your database, a ⭐ helps others find it.

## Install

- **macOS:** `brew install --cask createdbyadham/tap/litedb`, or download the
  [Apple silicon](https://github.com/createdbyadham/LiteDB/releases/download/v2.9.0/LiteDB_2.9.0_aarch64.dmg)
  or [Intel](https://github.com/createdbyadham/LiteDB/releases/download/v2.9.0/LiteDB_2.9.0_x64.dmg)
  .dmg. Signed and notarized by Apple.
- **Windows:** Scoop (below), `winget install AdhamEhab.LiteDB` once its winget
  listing is approved, or download the
  [installer](https://github.com/createdbyadham/LiteDB/releases/download/v2.9.0/LiteDB_2.9.0_x64-setup.exe)
  or [.msi](https://github.com/createdbyadham/LiteDB/releases/download/v2.9.0/LiteDB_2.9.0_x64_en-US.msi).
  The installers are not code-signed yet, so SmartScreen may warn: choose
  **More info**, then **Run anyway**.
- **Linux:** [AppImage](https://github.com/createdbyadham/LiteDB/releases/download/v2.9.0/LiteDB_2.9.0_amd64.AppImage),
  [.deb](https://github.com/createdbyadham/LiteDB/releases/download/v2.9.0/LiteDB_2.9.0_amd64.deb)
  or [.rpm](https://github.com/createdbyadham/LiteDB/releases/download/v2.9.0/LiteDB-2.9.0-1.x86_64.rpm).

```powershell
scoop bucket add litedb https://github.com/createdbyadham/scoop-bucket
scoop install litedb/litedb
```

## Connect Claude Code in 30 seconds

1. Open a database in LiteDB: drop a SQLite file on the window, or paste a
   `postgres://` or `mysql://` URL.
2. Add LiteDB as an MCP server, then start a new Claude Code session:

   ```bash
   # macOS
   claude mcp add litedb --scope user -- /Applications/LiteDB.app/Contents/MacOS/LiteDB --mcp
   ```

   ```powershell
   # Windows, default install
   claude mcp add litedb --scope user -- "$env:LOCALAPPDATA\LiteDB\LiteDB.exe" --mcp
   ```

   Settings → **Agents** in LiteDB copies the exact command for your install,
   adds LiteDB to Claude Desktop in one click, and has snippets for Cursor,
   VS Code and OpenCode.
3. Ask Claude to *"delete the shipped orders"*. LiteDB shows the rows it would
   delete and waits. Click **Approve**, then **Undo** in the Audit tab to put
   them back.

More hosts, and what the agent can and cannot do: [Connect an agent](docs/connect-an-agent.md).

## What it does

**With agents**

- **Approve in the app.** An agent's write waits in the LiteDB window with the
  exact row count and the rows it changes, even when the agent's app runs tools
  without asking.
- **Undo any change.** Agents, Text to SQL, the editor, grid edits, imports and
  new tables: what a change touches is saved before it runs, and Undo puts it
  back without overwriting anything changed since. [What Undo covers](docs/write-safety.md#undo).
- **Audit log** of every statement that ran, who or what wrote it, and who
  approved it.
- **Production tag**: the connection opens read-only for you and for agents,
  with a red title bar.
- **Built-in MCP server**: `LiteDB --mcp`, no Node needed. Agents follow the
  connection on screen and work through the app's own connection.
  [MCP server](docs/mcp.md), and [where your password is kept](docs/connect-an-agent.md).

**Every day**

- **SQLite** opened in place, so multi-gigabyte files open instantly, and
  **PostgreSQL** with every schema, SSL modes and SSH tunnels. Supabase works
  with its session pooler string.
- **MySQL and MariaDB**, with the same approval, Undo, SSL modes and SSH tunnels.
- **SQL editor** with autocomplete for the columns of the tables in your query,
  run the statement under the cursor, tabs that survive a restart, history and
  saved scripts.
- **Text to SQL** (`Ctrl/Cmd+K`), **Explain** and **Fix with AI**, with OpenAI,
  Anthropic, Gemini, any OpenAI-compatible endpoint, or Ollama on your machine.
- **Table editor**: edit cells, insert and duplicate rows, filter, follow
  foreign keys, edit JSON, copy rows as CSV, JSON, INSERT or Markdown.
- **CSV, Excel and JSON files** open like a database, and CSV imports into a table.
- **Schema diagram** with auto-layout, exported as PNG or SVG.
- **pgvector semantic search** with local embedding models.

The full tour: [User guide](docs/guide.md).

## Measured, not asserted

The Text-to-SQL agent ships with a public benchmark: 109 cases scored by
execution accuracy, with a held-out split written after the prompt work and
never tuned against. `qwen2.5-coder:7b`, running locally on a 6 GB laptop GPU,
on SQLite:

| | Overall | Held-out |
| --- | ---: | ---: |
| Schema context + execution-guided repair | 77.3% | 67.6% |
| \+ retrieved few-shot exemplars | **85.6%** | **76.5%** |

On a second schema it never saw, it scores 91.7%. Every number reruns with
`npm run eval -- --provider ollama`; the method and all six experiments,
including the two that were rejected, are in [`evals/README.md`](evals/README.md).

85.6% is good for a 7B model on reads, which are the easy case. That is why
generated SQL never runs unattended: see [Write safety](docs/write-safety.md).

## Compared honestly

LiteDB is a SQLite, Postgres and MySQL desktop client with an agent and a
write-safety layer. It is not a replacement for a general DBA workbench.
If a mark in another column is wrong or out of date, please open an issue.

| | LiteDB | TablePlus | Beekeeper Studio | DBeaver |
| --- | :---: | :---: | :---: | :---: |
| SQLite + PostgreSQL | ✓ | ✓ | ✓ | ✓ |
| MySQL / MariaDB | ✓ | ✓ | ✓ | ✓ |
| SQL Server, Oracle and the rest | ✗ | ✓ | ✓ | ✓ |
| SSH tunnel / jump host | ✓ | ✓ | ✓ | ✓ |
| ERD | ✓ | paid | plugins | ✓ |
| Text to SQL (local or cloud) | ✓ | ✗ | ✗ | Pro AI |
| Write safety (classify, row-count approval, audit) | ✓ | ✗ | ✗ | ✗ |
| MCP server through those guardrails | ✓ | ✗ | ✗ | ✗ |
| An agent's write waits for Approve, with the rows it changes | ✓ | ✗ | ✗ | ✗ |
| Undo a change after it ran, from the audit log | ✓ | ✗ | ✗ | ✗ |
| pgvector semantic search in the app | ✓ | ✗ | ✗ | ✗ |
| JDBC / every obscure driver | ✗ | ✗ | ✗ | ✓ |
| Native polish / years of query UX | ✗ | ✓ | ✗ | ✗ |

The loss that matters in practice is **three dialects**. If you need SQL Server
or Oracle, use those tools. Use this one when a model is allowed near the
database, when production should be hard to change by accident, or when
pgvector is the point.

## Docs

- [User guide](docs/guide.md): connecting, the table editor, the SQL editor,
  files, the schema diagram, vector search
- [Write safety](docs/write-safety.md): how statements are classified, the
  four modes, approval, the audit log and Undo
- [Connect an agent](docs/connect-an-agent.md) and the [MCP server](docs/mcp.md)
- [Text to SQL](docs/text-to-sql.md) and its [benchmark](evals/README.md)
- [Architecture](docs/architecture.md), [Contributing](CONTRIBUTING.md),
  [Roadmap](ROADMAP.md), [Changelog](CHANGELOG.md)

## Build from source

Node.js 22.5 or later, and Rust stable:

```bash
git clone https://github.com/createdbyadham/LiteDB
cd LiteDB
npm install
npm run tauri dev
```

[CONTRIBUTING.md](CONTRIBUTING.md) lists the tests and how to open a pull
request. Issues labelled
[good first issue](https://github.com/createdbyadham/LiteDB/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
are small and each a tour of one part of the code.

## License

MIT. See [LICENSE](LICENSE).

TDQS

A4.1/5.0

Scored across 8 tools

Disambiguation4/5

Each tool has a stated role, and the descriptions explicitly delimit the tricky boundaries: query previews writes, write only runs them when pre-authorised, and execute_approved runs them by token. The residual overlap is real (query and write can both end up producing the same preview/token, and semantic_search is a specialised query), but the documentation resolves it well enough that an agent should pick correctly.

Naming Consistency4/5

All names are snake_case and mostly follow a verb_noun shape (describe_table, list_tables, list_vector_columns, audit_log, execute_approved). The minor deviations are the bare verbs `query` and `write` and the noun-first `audit_log`, which are readable but not strictly parallel.

Tool Count5/5

Eight tools is well within a healthy range and each one maps to a distinct step in the read/write/approve workflow plus schema inspection, auditing and vector search. Nothing looks redundant or bolted on.

Completeness4/5

The surface covers schema discovery, reads, guarded writes with an approval lifecycle, and an audit trail, which is essentially full lifecycle for a desktop DB agent. Gaps are minor but present: no way to cancel or revoke a pending token, no transaction/connection controls, and no explicit index or DDL guidance beyond describe_table's output.

Maintenance

ActivityActive
ResponsivenessLimited data