If you've ever set up a test database, you know the pain:
INSERT INTO users VALUES ('test123', 'asdf@qwerty', '99999', 'ZZZ');
This "data" is useless for realistic testing. You can't demo your app to stakeholders, test search algorithms, validate UI formatting, or catch edge cases.
I'm building SynthDB to solve this - a zero-config database seeder that reads your PostgreSQL schema and generates statistically realistic, semantically coherent data. The project is in active development and I'm looking for contributors!
The "Aha!" Moment
The key insight: column names contain semantic information.
merchant_name → should be a company name
support_email → should be a support email (matching the company)
mac_address → should be a valid MAC address
birth_date → should be a realistic age
By analyzing column names and types together, we can infer context and generate appropriate data.
How It Works (Current Implementation)
SynthDB works in six stages:
Schema Introspection - Read tables, columns, constraints
Dependency Analysis - Topological sort for foreign key order
Semantic Classification - Detect column meaning
Context-Aware Generation - Generate coherent data
Constraint Validation - Ensure constraints satisfied
Output - SQL file or direct insertion
Real-World Example
Given this schema:
CREATE TABLE companies ( id SERIAL PRIMARY KEY, name VARCHAR(100) NOT NULL, website VARCHAR(255) );
CREATE TABLE employees ( id SERIAL PRIMARY KEY, company_id INTEGER REFERENCES companies(id), first_name VARCHAR(50) NOT NULL, last_name VARCHAR(50) NOT NULL, email VARCHAR(100) UNIQUE NOT NULL, salary NUMERIC(10,2) );
SynthDB generates:
INSERT INTO companies VALUES (1, 'TechVision Solutions', 'https://techvision.io');
INSERT INTO employees VALUES (1, 1, 'Alice', 'Chen', 'alice.chen@techvision.io', 125000.00), (2, 1, 'Bob', 'Kumar', 'bob.kumar@techvision.io', 135000.00);
Notice: ✅ Employee emails match the company domain ✅ Names are culturally diverse ✅ Salaries respect NUMERIC(10,2) precision ✅ Foreign keys reference valid parent IDs
Current Usage
Installation: cargo install synthdb
Basic usage: synthdb clone --url "postgres://user:pass@localhost:5432/mydb" --rows 1000 --output seed.sql
Advanced: synthdb clone --url "postgres://..." --rows 5000 --execute synthdb clone --url "postgres://..." --exclude "logs,temp_*" synthdb clone --url "postgres://..." --locale "en_GB"
Development Status
⚠️ This is an early-stage project! Currently supports PostgreSQL only.
What's working: ✅ PostgreSQL schema introspection ✅ Semantic column detection (50+ categories) ✅ Foreign key resolution ✅ Context-aware data generation ✅ Constraint validation
What's on the roadmap:
MySQL/MariaDB support
SQLite support
Custom data providers
GraphQL schema support
Performance benchmarking suite
Web UI for configuration
Machine learning-based pattern detection
Why I Need Your Help
SynthDB is MIT licensed and I'm actively seeking contributors! Whether you're:
A Rust beginner wanting to contribute to a real project
A database expert who knows edge cases
Interested in data generation algorithms
Good at writing documentation
Passionate about testing
Areas Needing Help:
MySQL/MariaDB Adapter - Biggest priority
Additional Semantic Categories - More data types
Performance Optimization - Making it faster
Test Coverage - More comprehensive tests
Documentation - Tutorials, guides, examples
Bug Reports - Try it with your schemas!
Tech Stack:
Rust (performance & memory safety)
Tokio (async runtime)
SQLx (database toolkit)
Fake-rs (data generation)
Why Rust?
I chose Rust because:
Performance - Generating millions of rows needs to be fast
Memory Safety - No crashes during long-running generation
Async - Tokio enables efficient database operations
Type Safety - Catches bugs at compile time
Ecosystem - Excellent database and testing crates
How to Contribute
Star the repo: https://github.com/synthdb/synthdb
Try it with your database schemas
File issues for bugs or feature requests
Submit PRs (I'm happy to mentor!)
Spread the word
Beginner-Friendly Issues
I'm tagging issues as "good first issue" for newcomers. Perfect if you want to:
Learn Rust by contributing
Understand database internals
Work on a practical open-source project
Get Involved
GitHub: https://github.com/synthdb/synthdb Crates.io: https://crates.io/crates/synthdb Issues: https://github.com/synthdb/synthdb/issues Discussions: https://github.com/synthdb/synthdb/discussions
Final Thoughts
SynthDB solves a real problem: generating realistic test data without manual configuration. By leveraging semantic analysis and Rust's performance, it aims to provide a production-ready solution that's both powerful and simple to use.
But I can't do it alone! If you're interested in databases, Rust, or data generation, I'd love your contribution - whether it's code, documentation, testing, or just feedback.
Try it out: cargo install synthdb synthdb clone --url "postgres://localhost/mydb" --rows 1000
Let me know what you think! Drop a star if you find it interesting, and let's build something useful together! 🦀
Made with ❤️ and Rust MIT License | Looking for Contributors!
Top comments (0)