📝 Input SQL
⚙️ Conversion Options
📦 Prisma Schema Output
// Paste SQL CREATE TABLE statements on the left to auto-generate Prisma Schema
Free online tool to convert SQL CREATE TABLE statements into Prisma model definitions. Supports MySQL/PostgreSQL/SQLite dialects with auto foreign key detection.
Zero Dependencies · Works Offline// Paste SQL CREATE TABLE statements on the left to auto-generate Prisma Schema
The SQL to Prisma Schema Generator is an online tool for Node.js/TypeScript developers that automatically converts SQL CREATE TABLE statements into Prisma Schema model definitions. When migrating from traditional SQL databases to Prisma ORM, this tool saves you from manually writing schema.prisma files by generating Prisma-compliant model code with one click.
1. Paste your SQL CREATE TABLE statements into the input box, or click "Load Example" for a demo; 2. Select database dialect (MySQL/PostgreSQL/SQLite) and naming style; 3. The tool auto-generates Prisma Schema code in real-time; 4. Click "Copy" to copy the schema to clipboard, or download as .prisma file; 5. Place the code in your project's schema.prisma file and run npx prisma generate.
When migrating from traditional SQL projects to Prisma ORM, batch convert existing CREATE TABLE statements to Prisma Schema for a quick ORM switch.
After DBA designs the database schema, frontend developers use this tool to quickly generate Prisma models and start TypeScript full-stack development.
Reverse-engineer Prisma Schema from legacy database DDL scripts, bringing modern ORM solutions to old projects.
Prisma is a next-generation TypeScript ORM with a declarative schema.prisma file at its core. Unlike traditional ORMs like TypeORM/Sequelize that use classes and decorators, Prisma defines models through Schema and auto-generates type-safe clients. Prisma supports auto-migration (prisma migrate dev), data browser (prisma studio), and a powerful query API. SQL-to-Prisma type mapping follows official conventions: INT→Int, BIGINT→BigInt, VARCHAR→String, BOOLEAN→Boolean, DATETIME→DateTime, DECIMAL→Decimal, etc.
Prisma is a next-generation TypeScript/Node.js ORM tool that uses a declarative schema.prisma file to define data models and auto-generates type-safe database clients.
MySQL, PostgreSQL, and SQLite. Dialect-specific types are automatically mapped to corresponding Prisma types.
Yes. The tool auto-detects FOREIGN KEY constraints and generates corresponding Prisma relation fields with @relation attributes.
Yes. The generated code follows Prisma official conventions with model definitions, field types, and attribute annotations.
SQL ENUM types are automatically converted to Prisma enum definitions, placed before model declarations with values fully preserved.
Completely safe. This tool runs 100% in the browser. Your SQL statements are processed only in local memory, never uploaded to any server.