Skip to main content
sqlprismaormschemadeveloper-toolswebdevtoolbox

How to Use SQL to Prisma Schema — WebdevToolbox Guide

Convert CREATE TABLE SQL statements into Prisma schema models.

WebdevToolbox Team3 min read

Adopting Prisma on top of an existing database means hand-writing a schema model for every table you already have — unless you convert your CREATE TABLE statements directly.

What Is SQL to Prisma Schema?

SQL to Prisma Schema is one of the tools in WebdevToolbox’s SQL Tools category. Paste one or more CREATE TABLE statements and get equivalent Prisma schema models, complete with primary keys, nullability, defaults, and @unique/@id/@map attributes.

How to Use It

  1. Open the tool at /tools/sql-to-prisma.
  2. Paste your CREATE TABLE statement(s) — standard SQL, MySQL, or PostgreSQL syntax all work.
  3. Copy the generated Prisma model(s) from the output panel.
  4. Add any relation fields manually — foreign keys aren’t inferred automatically, since Prisma relations require matching fields on both sides.

Key Features

  • Snake_case to camelCase mapping — column names are converted for Prisma fields, with a @map attribute added automatically to preserve the original database column name.
  • Primary key detection — recognizes both inline PRIMARY KEY and standalone PRIMARY KEY (...) constraint lines.
  • Multiple tables at once — paste several CREATE TABLE statements together and get one model per table.
  • 100% private — parsing and generation run entirely in your browser.

When to Use SQL to Prisma Schema

  • Adopting Prisma on top of an existing database schema.
  • Reviewing schema changes by converting a migration’s CREATE TABLE into the Prisma model it should produce.
  • Learning Prisma schema syntax by seeing it generated from SQL you already understand.

Try It Now

Open SQL to Prisma Schema directly from anywhere on the site using ⌘K and typing the tool name.


Part of the SQL Tools collection on WebdevToolbox — free, browser-based developer tools with no login required.

Tagged with

sqlprismaormschemadeveloper-toolswebdevtoolbox

Related posts