MySQL & PostgresType Mapping100% Private
model Users {
  id  Int @id @default(autoincrement())
  email  String @unique
  name  String?
  password_hash  String
  is_active  Boolean @default(true)
  created_at  DateTime @default(now())
  updated_at  DateTime @default(now()) @updatedAt
}

model Posts {
  id  Int @id @default(autoincrement())
  title  String
  content  String?
  published  Boolean @default(false)
  author_id  Int
  created_at  DateTime @default(now())
}

FAQ

What SQL dialects are supported?
MySQL, PostgreSQL, and standard SQL CREATE TABLE statements are all handled.
Does it handle constraints?
Yes. PRIMARY KEY, NOT NULL, UNIQUE, DEFAULT values, and AUTO_INCREMENT/SERIAL are converted to Prisma attributes.
Does it handle relations?
Foreign key columns are detected and typed, but relation fields need to be added manually in Prisma.
Share:

About SQL to Prisma

What this tool does

Data converter tools transform structured data between JSON, CSV, YAML, XML, TOML, SQL, TypeScript interfaces, Go structs, and more. They handle nested objects, arrays, and type inference automatically.

Why use this tool

APIs return JSON, spreadsheets export CSV, infrastructure config uses YAML, and legacy systems speak XML. Being able to convert between these formats without writing a custom script saves hours of tedious data wrangling.

How it works

The tool parses your input format into an in-memory object tree, then serializes that tree into the target format. Type information (string, number, boolean) is inferred from values and mapped to the closest equivalent in the output format.

Pro tip

When converting CSV to JSON, the first row is treated as column headers by default. If your CSV has no headers, toggle that option off to get array-of-arrays output instead.

Love this tool? Explore 12467+ more

Free online tools for images, PDFs, text, code, and more. All running in your browser.

Explore All Tools