Skip to content

Change default schema.prisma #1478

@Jolg42

Description

@Jolg42

The current default schema.prisma from prisma2 init
https://github.com/prisma/prisma2/blob/master/cli/introspection/src/commands/Init.ts#L9-L36

Right now there are instructions before, in the middle and after the datasource block
Screen Shot 2020-01-30 at 10 56 11

It would be great to have a quick and easy SQLite example so it's easy to try Prisma 2 in a minute.

My suggestion

// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

// The \`datasource\` block is used to specify the connection to your DB.
// Set the \`provider\` field to match your DB type: "postgresql", "mysql" or "sqlite".
// The \`url\` field must contain the connection string to your DB.
// Learn more about connection strings for your DB: https://pris.ly/d/connection-strings
// You can use environment variables to specify the connection string: https://pris.ly/d/prisma-schema#using-environment-variables
//
// Choose and uncomment one of the following example between SQLite, PostgreSQL or MySQL:

// datasource sqlite-db {
//  provider = "sqlite"
//  url      = "sqlite:./dev.db"
// }

// datasource postgresql-db {
//   provider = "postgresql"
//   url      = "postgresql://johndoe:johndoe@localhost:5432/mydb?schema=public"
// }

// datasource mysql-db {
//   provider = "mysql"
//   url      = "mysql://johndoe:johndoe@localhost:3306/mydb"
// }

// By adding the \`generator\` block, you specify that you want to generate Prisma's DB client.
// The client is generated by runnning the \`prisma2 generate\` command and will be located in \`node_modules/@prisma\` and can be imported in your code as:
// import { PrismaClient } from '@prisma/client'
generator client {
  provider = "prisma-client-js"
}

// Next steps:
// 1. Pick a datasource example and add your DB connection string as the \`url\` of the \`datasource\` block
// 2. Run \`prisma2 introspect\` to get your data model into the schema (this will override this file and delete all comments!)
// 3. Run \`prisma2 generate\` to generate Prisma Client JS
// 4. Start using Prisma Client JS in your application

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions