sql-splitter
Split large SQL dump files into individual table files. Fast, memory-efficient, multi-dialect.
- 600+ MB/s throughput on modern hardware
- MySQL, PostgreSQL, SQLite support (including
COPY FROM stdin) - Compressed files — gzip, bzip2, xz, zstd auto-detected
- Streaming architecture — handles files larger than RAM
- 5x faster than shell-based alternatives
Installation
From crates.io
From source
Or download pre-built binaries from GitHub Releases.
Usage
# MySQL/MariaDB dump (default)
# PostgreSQL pg_dump
# SQLite dump
# Compressed files (auto-detected)
# Split specific tables only
# Schema only (CREATE TABLE, indexes, etc.)
# Data only (INSERT/COPY statements)
# Analyze without splitting
# Generate shell completions (auto-installed with make install)
Shell Completions
Shell completions are automatically installed when using make install. For manual installation:
# Install for current shell only
# Install for all shells (bash, zsh, fish)
Options
| Flag | Description | Default |
|---|---|---|
-o, --output |
Output directory | output |
-d, --dialect |
SQL dialect: mysql, postgres, sqlite |
auto-detect |
-t, --tables |
Only split these tables (comma-separated) | — |
-p, --progress |
Show progress bar | — |
--dry-run |
Preview without writing files | — |
--schema-only |
Only DDL statements (CREATE, ALTER, DROP) | — |
--data-only |
Only DML statements (INSERT, COPY) | — |
Performance
See BENCHMARKS.md for detailed comparisons.
Testing
# Unit tests
# Verify against real-world SQL dumps (MySQL, PostgreSQL, WordPress, etc.)
License
MIT — see LICENSE.md