SQL to Prisma Seed Script Generator

Convert SQL INSERT statements into Prisma Client seed scripts (TypeScript) with createMany or individual create calls.

What is SQL to Prisma Seed Script Generator?

This tool converts SQL INSERT statements into Prisma Client seed scripts in TypeScript. It parses table names, column names, and values from INSERT statements, then generates a complete seed.ts file with Prisma Client create or createMany calls for database seeding.

How to Use

  1. Configure whether to use createMany for batch inserts or individual create calls
  2. Paste your SQL INSERT statements into the input area
  3. Click "Generate" and save the output as prisma/seed.ts in your project
  4. Add "seed": "ts-node prisma/seed.ts" to your package.json and run npx prisma db seed

Why Use This Tool?

Automatically parse SQL INSERT statements and extract table, columns, and values
Generate Prisma Client seed scripts with proper TypeScript types
Support createMany for efficient batch inserts or individual create calls
Convert SQL column names to camelCase following Prisma conventions
Handle strings, numbers, booleans, and null values correctly

Tips & Best Practices

  • Use createMany for better performance when inserting multiple rows into the same table
  • Column names are automatically converted from snake_case to camelCase
  • Table names are converted to PascalCase for Prisma model references
  • Make sure your Prisma schema models match the table and column names in your SQL

Frequently Asked Questions

What is a Prisma seed script?

A Prisma seed script is a TypeScript file that populates your database with initial or test data using Prisma Client. It is typically stored as prisma/seed.ts and executed with the npx prisma db seed command.

When should I use createMany vs create?

Use createMany when inserting multiple rows into the same table for better performance (single SQL statement). Use individual create calls when you need to work with relations or when each insert depends on the result of a previous one.

How are SQL values converted to TypeScript?

SQL strings are converted to TypeScript strings with proper escaping, integers to number, decimals to number, TRUE/FALSE to true/false, and NULL to null. All values are properly formatted for TypeScript syntax.

How do I run the seed script?

Add "seed": "ts-node prisma/seed.ts" to your package.json scripts, install ts-node as a dev dependency, then run npx prisma db seed. Prisma will automatically execute the seed script against your database.

Is my data sent to a server?

No, all processing happens entirely in your browser. Your SQL data never leaves your device.

Related Tools