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
- Open the tool at /tools/sql-to-prisma.
- Paste your
CREATE TABLEstatement(s) — standard SQL, MySQL, or PostgreSQL syntax all work. - Copy the generated Prisma model(s) from the output panel.
- 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
@mapattribute added automatically to preserve the original database column name. - Primary key detection — recognizes both inline
PRIMARY KEYand standalonePRIMARY KEY (...)constraint lines. - Multiple tables at once — paste several
CREATE TABLEstatements 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 TABLEinto 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.