Installation
Pre-Built Binaries
Pre-built binaries are available on the Releases page for Linux, macOS, and Windows.
Download the appropriate binary for your platform and add it to your PATH.
Homebrew
For macOS and Linux users with Homebrew:
brew install EvilBit-Labs/tap/dbsurveyor
From Source
Prerequisites
- Rust 1.93.1+ (MSRV)
- Git
Clone and Build
git clone https://github.com/EvilBit-Labs/dbsurveyor.git
cd dbsurveyor
cargo build --release
The compiled binaries will be available in target/release/.
Feature Selection
Control which database engines are compiled in using feature flags:
# Build with all database support
cargo build --release --all-features
# Build with specific databases only
cargo build --release --features postgresql,mysql,encryption
# Build minimal version for airgap environments
cargo build --release --no-default-features --features sqlite
Feature Flags
| Feature | Description | Dependencies |
|---|---|---|
postgresql | PostgreSQL support | sqlx with postgres driver |
mysql | MySQL support | sqlx with mysql driver |
sqlite | SQLite support | sqlx with sqlite driver |
mongodb | MongoDB support | mongodb crate |
mssql | SQL Server support | tiberius crate |
compression | Zstandard compression | zstd crate |
encryption | AES-GCM encryption | aes-gcm, argon2 crates |
Default Features
default = ["postgresql", "sqlite"]
The default build includes PostgreSQL and SQLite support, which covers the most common use cases while maintaining a reasonable binary size.
Binary Variants
DBSurveyor provides two main binaries:
dbsurveyor-collect
The database collection tool that connects to databases and extracts schema information.
- Default Features:
postgresql,sqlite - Optional Features:
mysql,mongodb,mssql,compression,encryption
dbsurveyor
The documentation generator that processes collected schema files.
- Default Features: None (minimal dependencies)
- Optional Features:
compression,encryption
Development Setup
For development work, install the complete toolchain:
# Install development dependencies
just install
# This installs:
# - Rust toolchain components (clippy, rustfmt)
# - Cargo tools (audit, deny, llvm-cov, nextest)
# - Security tools (syft for SBOM generation)
# - Documentation tools (mdbook and plugins)
Verification
Verify your installation:
# Check binary versions
./target/release/dbsurveyor-collect --version
./target/release/dbsurveyor --version
# Test with SQLite (no external database required)
echo "CREATE TABLE test (id INTEGER);" | sqlite3 test.db
./target/release/dbsurveyor-collect sqlite://test.db
./target/release/dbsurveyor schema.dbsurveyor.json
# Clean up
rm test.db schema.dbsurveyor.json schema.md
Airgap Installation
For air-gapped environments:
-
Prepare on connected system:
# Download dependencies cargo fetch # Create vendor directory cargo vendor vendor # Build minimal version cargo build --release --no-default-features --features sqlite -
Transfer to airgap system:
- Copy entire project directory including
vendor/ - Copy built binaries from
target/release/
- Copy entire project directory including
-
Use offline:
# Use vendored dependencies cargo build --release --offline --no-default-features --features sqlite
Troubleshooting
Common Issues
Compilation fails with missing dependencies:
- Ensure you have the latest Rust toolchain:
rustup update - Check feature flags match your requirements
Database driver compilation errors:
- Install system dependencies for your target databases
- For PostgreSQL:
libpq-dev(Ubuntu) orpostgresql-devel(RHEL) - For MySQL:
libmysqlclient-dev(Ubuntu) ormysql-devel(RHEL)
Permission errors:
- Ensure you have write permissions to the target directory
- Use
cargo install --root ~/.localfor user-local installation
Getting Help
- Check the Troubleshooting section
- Review GitHub Issues
- Consult the CLI Reference for command-specific help