You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when running npx prisma init, a user encounters an error message if they attempt to launch prisma studio without defining any models in their schema.prisma file. While the error message clearly guides the user towards defining a model, it can be a minor hurdle for beginners.
Suggestion:
To provide a more seamless experience for new users, consider incorporating a basic model pre-definition within the schema.prisma file generated by npx prisma init. This model could be something simple like:
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
}
Benefits:
Reduced Friction for New Users: This pre-defined model would allow users to immediately explore prisma studio without encountering the initial error message, streamlining their onboarding journey.
Learning Opportunity: The basic model serves as a starting point for users to understand the concept of models and schema definition in Prisma. They can then customize or extend this model as their project evolves.
Additional Points:
Configuration Option: If providing a pre-defined model is deemed unnecessary, consider adding a configuration option within npx prisma init that allows users to choose whether or not to include a basic model.
Error Handling Improvement: Explore ways to enhance the error message when no models are defined. This could involve providing more specific guidance for defining a model alongside the link to the documentation.
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
Bug description
Currently, when running npx prisma init, a user encounters an error message if they attempt to launch prisma studio without defining any models in their schema.prisma file. While the error message clearly guides the user towards defining a model, it can be a minor hurdle for beginners.
Suggestion:
To provide a more seamless experience for new users, consider incorporating a basic model pre-definition within the schema.prisma file generated by npx prisma init. This model could be something simple like:
Benefits:
Additional Points:
How to reproduce
Expected behavior
No response
Prisma information
schema.prisma
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
Environment & setup
Prisma logs
The text was updated successfully, but these errors were encountered: