Prisma Orm Datatype

1 min read

There are two part of PRISMA ORM
PRISMA CLI “Prisma CLI Generate a Prisma Client for database access”
PRISMA CLINET “USE TO ACCESS THE DATABASE READ AND WRITE"
INSTALLATION
npm install prisma
npm install @prisma/client
npx prisma init --datasource-provider mysql
# go to prisma/schema.prisma > remove output in client output = "../generated/prisma"
# because it genrate cline in specific directory.
# to genrate in defalut remove it default directory is node_modules/@prisma/client
# and node_modules/.prisma/client
npx prisma genrate
GO TO PRISMA/SCHEMA.PRISMA > START WIRTING SCHEMA HERE.
AFTER THIS RUN
npx prisma migrate dev —name=”migration_name”
migration workflow
generate migration.sql
update database
generate prisma client to use in project
USE PRISMA IN EXISTING DATABASE
USE CUSTOM MODEL AND FIELD NAME
CHANGES CONTINUE USING THIS COMMAND
WORKFLOW OF PRISMA
DATA TYPE IN PRISMA
PERMISSIONS
USE EXTERNAL DRIVER
0
Subscribe to my newsletter
Read articles from Anu Mau directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
