ddl-generator

Convert a JSON data model into PostgreSQL schema, sample data, and query files.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/tis-abe-akira/cc-data-modeler --skill ddl-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddl-generator
Source: https://github.com/tis-abe-akira/cc-data-modeler/tree/main/.claude/skills/ddl-generator
Command: npx skills add https://github.com/tis-abe-akira/cc-data-modeler --skill ddl-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill converts an immutable data model into ready-to-run PostgreSQL artifacts, enabling seamless database design from a JSON model.

Core Features & Use Cases

  • Model-to-schema generation: Produce schema.sql with resource, event, and junction tables following best practices.
  • Sample data and queries: Generate sample_data.sql and query_examples.sql to validate and demonstrate the plan.
  • Use Case: Given artifacts/{project-name}/model.json, generate a complete database implementation in artifacts/{project-name}/, including comments and indexes.

Quick Start

Use the ddl-generator skill to turn artifacts/{project-name}/model.json into a full PostgreSQL setup, including schema.sql, sample_data.sql, and query_examples.sql.

Frequently Asked Questions about ddl-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate PostgreSQL schema.sql from a JSON data model?

To generate a PostgreSQL schema.sql from a JSON data model, you need a tool that reads an immutable model.json file and outputs executable database artifacts. This process creates complete database implementations including resource, event, and junction tables.

What is the best way to create sample data and query examples for a PostgreSQL schema?

Creating sample data and query examples for a PostgreSQL schema involves generating sample_data.sql and query_examples.sql files alongside the main schema. This validates and demonstrates the database plan directly from the defined data model.

Can I automatically enforce naming conventions and foreign keys when generating PostgreSQL DDL?

Yes, you can enforce naming conventions and foreign keys with ON DELETE RESTRICT during PostgreSQL DDL generation. By using an artifact-driven approach, the schema output strictly follows predefined rules including index creation and Japanese comments.

Does artifact-driven SQL generation support junction tables and event tables?

Artifact-driven SQL generation fully supports junction tables and event tables. It converts an immutable data model into a complete PostgreSQL setup, producing executable schema files that include all required resources, events, and junctions.

What are the limitations of generating PostgreSQL artifacts from an immutable model?

A limitation of generating PostgreSQL artifacts from an immutable model is that the output schema strictly enforces ON DELETE RESTRICT for foreign keys and requires Japanese comments, which may not fit all existing database design workflows or conventions.

Do I need an existing model.json file to start generating a database schema?

Yes, you need an existing model.json file placed in the artifacts/{project-name}/ directory. This immutable data model serves as the required input to generate the executable PostgreSQL schema, sample data, and query examples.