Developer Builds Tool for Realistic Relational Database Generation

✍️ OpenClawRadar📅 Published: March 24, 2026🔗 Source
Developer Builds Tool for Realistic Relational Database Generation
Ad

Tool Solves Database Generation Problem for App Development

A developer on r/ClaudeAI shared their solution to a common problem when building apps with Claude Code: the need for realistic, fully loaded relational databases for testing and demos. While prompting Claude worked for small datasets, generating larger datasets with intact foreign key relationships became messy.

Technical Approach That Worked

The developer built a tool with several key technical approaches:

  • Topological generation: The system resolves the foreign key dependency graph and generates tables in the correct order—parent tables first, then children—with every foreign key pointing to a real parent row.
  • Cardinality modeling: Instead of uniform distributions, the generator uses distributions matching real-world patterns. For example, order counts per user follow a negative binomial distribution, and activity timestamps cluster around business hours with realistic seasonal variation. The system infers these patterns from schema structure and column names without requiring configuration.
  • Cross-table consistency: The system handles implicit business rules not declared as foreign key constraints, such as ensuring payment dates come after invoice dates, or that an employee's department and salary match their job title in the appropriate currency. These rules are inferred from naming conventions and table relationships.
  • Schema from plain English: Users describe what they need (e.g., "a SaaS app with organizations, users, projects, tasks, and an activity log") and the tool builds the full schema with all relationships, column types, and constraints, then generates the data in one shot.
Ad

Development Context

The developer noted that while the application was coded with Claude Code, the generation engine itself—the part that solves the constraint graph and models distributions—had to be architected manually. They found that 100% reliance on LLMs for generating this data was not scalable nor reliable enough.

The developer is now working on building MCP (Model Context Protocol) to work with Claude.

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also