How to use the JSON → Prisma Schema
1. Paste a JSON object representing one record from your data source (API response, database row, etc.).
2. Set the model name (PascalCase, singular — e.g. User, Product, Order) and choose your database provider.
3. The Prisma schema model is generated — paste it into your schema.prisma file and run npx prisma db push.
Tip: fields named id or _id automatically get @id @default(...). email gets @unique. createdAt/updatedAt get @default(now())/@updatedAt.
What is it?
Prisma is the most popular Node.js/TypeScript ORM, used with Next.js, NestJS, Express, and Remix. The schema.prisma file is the source of truth for your database schema — Prisma uses it to generate a fully typed client and run migrations.
Writing Prisma models manually from an API response or existing data structure is tedious. This tool infers the correct Prisma scalar types (String, Int, Float, Boolean, DateTime), detects common fields automatically (id, email, timestamps), and generates nested model definitions for embedded objects.
The generated output includes the datasource and generator blocks so you can paste the entire thing into a new schema.prisma file and start immediately. Null JSON values are mapped to optional fields (with ? suffix).
Example
{"id": 1, "email": "[email protected]", "createdAt": "2024-01-15T10:30:00Z"}model User {
id Int @id @default(autoincrement())
email String @unique
createdAt DateTime @default(now())
}Run 'npx prisma db push' to sync the schema to your database, or 'npx prisma migrate dev' to create a migration.
Benefits
Generate accurate code from your actual data
TypeScript interfaces, Python dataclasses, and OpenAI function schemas are generated directly from your real JSON — accurate field names, correct types, no guesswork.
Control LLM API costs before you scale
Token counts and per-call cost estimates for GPT-4o, Claude 3.5, and Gemini let you optimise prompt size and model choice before a feature goes to production.
Ready-to-run code and configs, not boilerplate
Every tool produces output you can paste directly into your project — API request code, prompt templates, chunk configurations — adapt rather than write from scratch.
Purpose-built for AI engineering workflows
From RAG chunking strategy to prompt template selection to function calling schema design — tools built for the specific problems AI engineers encounter daily.
Frequently asked questions
How do I add relations between Prisma models?
After generating individual models, add relation fields manually: User has Post[] (one-to-many), Post has userId Int + user User @relation(fields: [userId], references: [id]). Prisma's relation docs cover the full syntax.
What is the difference between db push and migrate dev?
prisma db push syncs schema directly to the database without creating migration files — great for prototyping. prisma migrate dev creates migration SQL files and applies them — required for production. Use db push during development, migrate for production.
How do I generate the Prisma client after updating the schema?
Run npx prisma generate. This re-generates the TypeScript client in node_modules/@prisma/client. If you changed the schema significantly, also run npx prisma db push or npx prisma migrate dev.
Why does my JSON array become a Json field instead of a relation?
Arrays of primitive values (strings, numbers) map to Json type since Prisma doesn't support native array columns in all databases. Arrays of objects become related models. If you want a native array in PostgreSQL, manually change Json to String[].
Can I use this with MySQL or SQLite?
Yes — select your provider from the dropdown. The generated schema will use the correct provider string. Note that some features (like native arrays) are only available in PostgreSQL.