Skills2026年4月15日·1 分钟阅读

Dolt — The SQL Database You Can Fork, Clone, Branch and Merge

The world's first version-controlled SQL database. Dolt combines MySQL compatibility with Git-style branching, diffing and merging so schemas and data can be reviewed and pull-requested.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Dolt Guide
先审查命令
npx -y tokrepo@latest install f8c7831d-391f-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

TL;DR
MySQL-compatible database with Git-style branching, diffing, and pull requests for data.
§01

What it is

Dolt is a MySQL-compatible SQL database that adds Git-style version control to both schemas and data. You can branch, diff, merge, and create pull requests for your database the same way you do with code repositories. Every write creates an addressable commit, making it possible to review data changes, roll back mistakes, and collaborate on datasets.

Dolt targets data teams, ML engineers, and application developers who need auditable data history, reproducible datasets, or collaborative data editing with review workflows.

§02

How it saves time or tokens

Without version control, recovering from a bad migration or data import requires restoring backups, which can take hours. Dolt lets you branch before any risky operation, run it, inspect the diff, and merge only if the result looks correct. Row-level diffs make code review for data practical. The MySQL wire protocol means existing tools (ORMs, BI tools, SQL clients) work without modification.

§03

How to use

  1. Install Dolt and initialize a database:
curl -L https://github.com/dolthub/dolt/releases/latest/download/install.sh | sudo bash
mkdir shop && cd shop
dolt init
  1. Create tables, insert data, and commit:
dolt sql -q "CREATE TABLE items (id INT PRIMARY KEY, name VARCHAR(64), price DECIMAL(10,2));"
dolt sql -q "INSERT INTO items VALUES (1,'Mug',9.99);"
dolt add . && dolt commit -m 'seed catalogue'
  1. Branch, modify, diff, and merge:
dolt checkout -b promo
dolt sql -q "UPDATE items SET price = price * 0.8;"
dolt diff main promo
dolt checkout main && dolt merge promo
§04

Example

Using Dolt as a standard MySQL server:

# Start SQL server
dolt sql-server -u root -p '' --port 3306

# Connect with any MySQL client
mysql -h 127.0.0.1 -u root shop

# Query version history
SELECT * FROM dolt_log LIMIT 5;
SELECT * FROM dolt_diff('main', 'promo', 'items');
§05

Related on TokRepo

§06

Common pitfalls

  • Dolt stores every version of every row, so storage grows faster than a traditional database; configure garbage collection and pruning for large datasets
  • While MySQL-compatible, some advanced features (stored procedures, certain window functions) may behave differently; test your specific SQL patterns
  • Merge conflicts on the same row require manual resolution, just like Git conflicts in code; establish clear branching conventions for multi-editor workflows

常见问题

Is Dolt a drop-in replacement for MySQL?+

Dolt uses the MySQL wire protocol and supports most MySQL syntax, so many applications work without changes. However, some advanced MySQL features like stored procedures or specific collations may differ. Test your application's SQL patterns against Dolt before migrating.

How does branching work in a database?+

Each branch is a full copy-on-write snapshot of the database. Creating a branch is instant because Dolt uses structural sharing (like Git). You can switch branches, make changes, and merge them back. Conflicts on the same row require manual resolution.

Can I use Dolt with ORMs like Prisma or SQLAlchemy?+

Yes. Since Dolt speaks the MySQL protocol, any ORM that supports MySQL can connect to Dolt. The version control features are accessed through special system tables (dolt_log, dolt_diff) or the dolt CLI, not through the ORM.

What is the performance compared to MySQL?+

Dolt benchmarks show query performance within 2-3x of MySQL for most workloads. Write performance is slower due to versioning overhead. For read-heavy analytical workloads or datasets under 100GB, the difference is usually acceptable.

Can I host Dolt remotely like GitHub?+

Yes. DoltHub is a free hosting platform for Dolt databases, similar to GitHub for code. You can push databases, create pull requests for data changes, and collaborate with others. DoltLab is the self-hosted alternative.

引用来源 (3)
  • Dolt GitHub— Dolt version-controlled SQL database
  • Dolt Docs— Dolt documentation and SQL compatibility
  • DoltHub— DoltHub collaborative data platform

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产