Prisma Init Generator
Generate an initial schema.prisma.
Starter schema.prisma with Postgres and User
Starting with Prisma almost always means copying the schema from an older project, because the syntax of the generator and datasource blocks is not something you type from memory. Add the model attributes on top of that, the @id, the @default(autoincrement()), the question mark that marks an optional field, and ten minutes are gone before your first migration.
The tool shows one complete, fixed schema with nothing to choose, already on screen when the page opens. You get a generator client block with provider prisma-client-js, a datasource db block with provider postgresql and url reading env("DATABASE_URL"), and a User model with an autoincrementing Int id, a unique String email, an optional String name and a createdAt DateTime defaulting to now(). The file belongs at prisma/schema.prisma.
After pasting, create a .env at the project root with DATABASE_URL pointing at your database, in the form postgresql://user:password@localhost:5432/name. Prisma reads that file on its own. Then run npx prisma migrate dev --name init, which applies the migration and generates the client. If your database already exists with tables, skip this schema and run npx prisma db pull instead, which builds models from what is really there. Runs in your browser.
Frequently asked questions
Can I pick MySQL or SQLite on the page?
Do I still need to run prisma init?
How do I generate the Prisma Client?
Related Tools
TypeORM Init Generator
Generate a starter TypeORM data-source.ts with a ready PostgreSQL connection, in TypeScript. Copy the file and start using entities and migrations.
Mongoose Init Generator
Generate the Mongoose connection to MongoDB plus a sample schema, ready to drop into your Node.js project. Start modeling your data in seconds.
Sequelize Init Generator
Generates the Sequelize ORM config/config.js with development, test and production environments, all on the postgres dialect. Copy it and adjust the credentials.