JSON-zu-SQL-CREATE-TABLE- und DDL-Generator

Wandle ein JSON-Beispiel in einen DDL-Entwurf für PostgreSQL, MySQL, SQLite, SQL Server oder Oracle um.

// about

Über dieses Tool

Das Tool erkennt Spalten und SQL-Typen aus einem JSON-Objekt und erzeugt einen DDL-Entwurf. Verschachtelte Werte werden als JSON oder Text behandelt; prüfe das Skript vor dem Produktiveinsatz.

So verwenden Sie es

  1. Füge ein repräsentatives JSON-Objekt ein.
  2. Wähle die Datenbank und gib den Tabellennamen ein.
  3. Generiere die DDL und prüfe Typen, Einschränkungen, Indizes und Beziehungen.

Warum dieses Tool genutzt wird

  • Erzeuge schnell einen SQL-Tabellenentwurf aus einem JSON-Beispiel.
  • Wähle PostgreSQL, MySQL, SQLite, SQL Server oder Oracle.
  • Nutze das Ergebnis als Ausgangspunkt für Spalten- und Typprüfungen.

Häufig gestellte Fragen (FAQ)

Entwirft das Tool ein vollständiges Datenbankschema?

Nein. Es erstellt einen Tabellenentwurf aus einem JSON-Beispiel. Ergänze Schlüssel, Einschränkungen, Indizes, Beziehungen und Migrationen.

Ratgeber · Daten · 7 Min. Lesezeit

UUID-Leitfaden: v4 oder v7 und UUIDs als Primärschlüssel in Datenbanken

Zeichenketten wie 550e8400-e29b-41d4-a716-446655440000 kennzeichnen überall Bestellungen, Dateien und API-Anfragen. Erfahren Sie, wie UUIDs erzeugt werden und welche Version Sie wählen sollten.

Eine UUID (Universally Unique Identifier) ist ein 128-Bit-Bezeichner, mit dem jeder kollisionsfreie IDs erzeugen kann, ohne einen zentralen Server zu fragen. Microsoft nennt sie GUID. Der aktuelle Standard ist RFC 9562 aus dem Jahr 2024.

Aufbau einer UUID, Unterschiede der Versionen, warum Kollisionen praktisch ausgeschlossen sind und warum v7 bei Primärschlüsseln v4 ablöst.
Ratgeber lesen →
Mit KI bauen

Dieses Tool selbst mit KI bauen

Sie möchten eine eigene Version? Kopieren Sie den Arbeitsauftrag in einen KI-Chat oder speichern Sie die Skill-Datei für einen KI-Coding-Agenten. Beide enthalten die Funktionen, Sonderfälle und Testfälle, die wir verwendet haben.

Prompt und Skill sind auf Englisch, das KI-Tools in jeder Sprache gut verstehen.

KI-Arbeitsauftrag (Prompt)

Unverändert in Claude, ChatGPT oder Gemini einfügen.

You are an experienced full-stack web developer. Build a web tool called "JSON-zu-DDL-Generator" that meets the requirements below.

## Goal

Build a tool that generates database CREATE TABLE statements from a JSON sample.

## Core features

- Choose MySQL, PostgreSQL, SQL Server or Oracle
- Infer column types from values
- Choose a primary key
- Option to map nested objects and arrays to child tables or JSON columns
- Copy result

## Inputs

- A JSON object or array of objects
- Database, table name, primary key

## Outputs

- CREATE TABLE SQL
- Reason for each inferred type

## Edge cases and handling rules

- Pick the widest type across rows (int + decimal → DECIMAL)
- Infer date/time types from ISO 8601 strings
- Allow NULL where null values appear
- Respect each database's identifier quoting and reserved words

## Implementation requirements

- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.
- Make the UI responsive and easy to use on mobile; label every input and keep everything keyboard accessible.
- Add a Copy button for results and show clear, friendly error messages for invalid input.
- Keep the core logic in functions separate from the UI so it can be unit-tested.

## Definition of done (test cases)

- {"id":1,"price":9.9,"createdAt":"2026-10-28T09:00:00Z"} gives integer, decimal and timestamp types
- PostgreSQL output uses double-quoted identifiers
- PRIMARY KEY appears when a key is chosen

First outline your implementation plan in at most five lines, then write the complete code, and finally explain how to check the test cases above.

Skill (SKILL.md)

Als .claude/skills/build-json-ddl-generator/SKILL.md speichern, damit Agenten wie Claude Code es bei jeder Änderung am Tool wiederverwenden.

---
name: build-json-ddl-generator
description: Use when building or changing a JSON-zu-DDL-Generator tool. Build a tool that generates database CREATE TABLE statements from a JSON sample.
---

# Build: JSON-zu-DDL-Generator

## Goal

Build a tool that generates database CREATE TABLE statements from a JSON sample.

## Workflow

1. Review the required features, inputs and outputs below and ask about anything missing first.
2. Implement the core logic as pure functions separate from the UI.
3. Check the logic against the test cases in the verification list.
4. Build a responsive UI with an input form, a result area and a Copy button.
5. Reproduce each edge case listed under Rules and refine the error messages.

## Core features

- Choose MySQL, PostgreSQL, SQL Server or Oracle
- Infer column types from values
- Choose a primary key
- Option to map nested objects and arrays to child tables or JSON columns
- Copy result

## Inputs

- A JSON object or array of objects
- Database, table name, primary key

## Outputs

- CREATE TABLE SQL
- Reason for each inferred type

## Rules

- Pick the widest type across rows (int + decimal → DECIMAL)
- Infer date/time types from ISO 8601 strings
- Allow NULL where null values appear
- Respect each database's identifier quoting and reserved words
- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.

## Verification

- [ ] {"id":1,"price":9.9,"createdAt":"2026-10-28T09:00:00Z"} gives integer, decimal and timestamp types
- [ ] PostgreSQL output uses double-quoted identifiers
- [ ] PRIMARY KEY appears when a key is chosen

Tipps für die Arbeit mit KI

  • Nennen Sie in der ersten Zeile Ihren Stack (React, Vue oder reines HTML), damit der Code passt.
  • Lassen Sie die KI die Testfälle ausführen und die Ergebnisse zeigen, bevor Sie den Code übernehmen.
  • Fügen Sie keine echten Passwörter, Kundendaten oder API-Schlüssel ein; nutzen Sie Beispielwerte.