SQL to Prisma Schema
Convert SQL CREATE TABLE statements to Prisma schema model definitions.
About Prisma
Prisma is a next-generation Node.js/TypeScript ORM. Its schema.prisma file defines data models in a declarative DSL (Domain Specific Language). The Prisma CLI generates a fully type-safe client from this schema. Prisma supports PostgreSQL, MySQL, SQLite, MongoDB, and SQL Server. This tool converts an existing SQL table definition to the equivalent Prisma model, including field types, constraints, and basic attributes.
FAQ
How do I add relations in Prisma?
Add a field with the related model type and a @relation attribute: author User @relation(fields: [authorId], references: [id]). Prisma requires explicit relation fields on both sides (one-to-many requires a @relation on the scalar foreign key field and a virtual relation field). The Prisma docs on relations are comprehensive — start there for one-to-one, one-to-many, and many-to-many patterns.