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.
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.
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.
How to use
- 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
- 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'
- 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
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');
Related on TokRepo
- AI Tools for Database — more database tools and management utilities
- Featured Workflows — discover popular developer tools on TokRepo
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
Frequently Asked Questions
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.
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.
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.
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.
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.
Citations (3)
- Dolt GitHub— Dolt version-controlled SQL database
- Dolt Docs— Dolt documentation and SQL compatibility
- DoltHub— DoltHub collaborative data platform
Related on TokRepo
Discussion
Related Assets
Conda — Cross-Platform Package and Environment Manager
Install, update, and manage packages and isolated environments for Python, R, C/C++, and hundreds of other languages from a single tool.
Sphinx — Python Documentation Generator
Generate professional documentation from reStructuredText and Markdown with cross-references, API autodoc, and multiple output formats.
Neutralinojs — Lightweight Cross-Platform Desktop Apps
Build desktop applications with HTML, CSS, and JavaScript using a tiny native runtime instead of bundling Chromium.