.PHONY: help build release native test bench profile profile-large profile-mega profile-giga fmt check clippy clean install install-completions install-completions-all install-man docker-build docker-bench verify-realworld website-deploy man schemas
help:
@echo "Available commands:"
@echo " make build - Debug build"
@echo " make release - Release build"
@echo " make native - Optimized build for current CPU (best performance)"
@echo " make test - Run all tests"
@echo " make bench - Run criterion benchmarks"
@echo " make profile - Memory profile all commands (medium dataset)"
@echo " make profile-large - Memory profile with large dataset (~125MB)"
@echo " make profile-mega - Stress test profile (~1GB: 100 tables × 100k rows)"
@echo " make profile-giga - Extreme stress test (~10GB MySQL only)"
@echo " make fmt - Format code (Rust + Markdown)"
@echo " make check - Check code without building"
@echo " make clippy - Run clippy lints"
@echo " make clean - Clean build artifacts"
@echo " make install - Install locally (binary + shell completions)"
@echo " make install-completions - Install completions only (for current shell)"
@echo " make install-completions-all - Install completions for all supported shells"
@echo " make docker-build - Docker benchmark setup"
@echo " make docker-bench - Run benchmarks in Docker (generates 100MB test data)"
@echo " make verify-realworld - Verify against real-world SQL dumps from public sources"
@echo " make website-deploy - Deploy website to Vercel"
@echo " make man - Generate man pages"
@echo " make schemas - Generate JSON schemas from Rust types"
build:
cargo build
release:
cargo build --release
native:
RUSTFLAGS="-C target-cpu=native" cargo build --release
test:
cargo test
bench:
cargo bench
profile: release
./scripts/profile-memory.sh --size medium --output benchmark-results/profile-medium.txt
profile-large: release
./scripts/profile-memory.sh --size large --output benchmark-results/profile-large.txt
profile-mega: release
./scripts/profile-memory.sh --size mega --output benchmark-results/profile-mega.txt
profile-giga: release
./scripts/profile-memory.sh --size giga --output benchmark-results/profile-giga.txt
fmt:
cargo fmt
npx prettier --write "**/*.md" --log-level warn
check:
cargo check
clippy:
cargo clippy -- -D warnings
clean:
cargo clean
install: man
cargo install --path .
@echo ""
@./scripts/install-completions.sh sql-splitter
@./scripts/install-man.sh
install-completions:
@./scripts/install-completions.sh sql-splitter
install-completions-all:
@./scripts/install-completions.sh sql-splitter all
install-man: man
@./scripts/install-man.sh
docker-build:
docker compose -f docker/docker-compose.benchmark.yml build
docker-bench:
./docker/run-benchmark.sh --generate 100
verify-realworld:
cargo test --test realworld -- --ignored
website-deploy:
cd website && vc --prod
man:
cargo run --example generate-man
@echo ""
@echo "Man pages generated in man/ directory"
@echo "Install with: sudo cp man/*.1 /usr/local/share/man/man1/"
schemas: release
@echo "Generating JSON schemas from Rust types..."
./target/release/sql-splitter schema -o schemas/
@echo ""
@echo "Formatting schemas with prettier..."
npx prettier --write "schemas/*.schema.json" --log-level warn
@echo ""
@echo "Validating schemas against actual CLI output..."
cargo test --test json_schema_tests -- --quiet
@echo ""
@echo "Copying schemas to website..."
cp schemas/*.schema.json website/public/schemas/
@echo ""
@echo "✓ Schemas generated, formatted, validated, and copied to website/public/schemas/"