Prisma yes Node.js and TypeScript The next generation of ORM. After more than two years of development , We're happy to share all Prisma The tools are ready for production !
A new paradigm of object relational mapping
Databases are hard
Prisma-Node.js and TypeScript Integrity ORM
Prisma Suitable for any technology stack
Prepare for the production of mission critical applications
from GraphQL To the database
We care about developers
The company uses Prisma
From prototyping to development to production
The next generation Web Based on the framework of Prisma structure
Open source and others
Prisma Is applicable to Node.js and TypeScript The next generation of open source ORM. It contains the following tools :
These tools can be used in any Node.js or TypeScript Used together or separately in a project .Prisma The current support PostgreSQL,MySQL,SQLite,SQL Server( preview ).MongoDB The connector for is under development , Please register here Early Access Program .
Using databases is one of the most challenging areas in application development . Data modeling , Schema migration and writing database queries are common tasks that application developers deal with every day .
stay Prisma, We found that Node.js Although ecosystems are becoming more and more popular in building database supported applications , But there is no modern tool for application developers to handle these tasks .
Application developers should care about data , instead of SQL
As tools become more specialized , Application developers should be able to focus on adding value to the organization , Instead of spending time writing glue code to traverse the layers of the application .
Even though Prisma It solves the problem with tradition ORM Similar questions , But its approach to these problems is fundamentally different .
Prisma Data modeling in patterns
Use Prisma when , You can go to Prisma Define the data model in the schema . Here are Prisma Examples of models :
model Post {
id Int @id @default(autoincrement())
title String
content String?
published Boolean @default(false)
author User? @relation(fields: [authorId], references: [id])
authorId Int?
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
posts Post[]
}
Each of these models maps to a table in the underlying database , And act as Prisma Client Provide generated data access API The basis of .Prisma Of VS Code Extensions provide syntax highlighting , Automatic completion , Quick fix and many other features , Make data modeling a magical and enjoyable experience .
Use Prisma Migrate Database migration
Prisma Migrate take Prisma The pattern is converted to the desired SQL, To create and change tables in the database . Can pass Prisma CLI Provided prisma migration
Command to use it .
PostgreSQL:
CREATE TABLE "Post" (
"id" SERIAL NOT NULL,
"title" TEXT NOT NULL,
"content" TEXT,
"published" BOOLEAN NOT NULL DEFAULT false,
"authorId" INTEGER,
PRIMARY KEY ("id")
);
CREATE TABLE "User" (
"id" SERIAL NOT NULL,
"email" TEXT NOT NULL,
"name" TEXT,
PRIMARY KEY ("id")
);
CREATE UNIQUE INDEX "User.email_unique" ON "User"("email");
ALTER TABLE "Post" ADD FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
Based on Prisma Patterns are generated automatically SQL At the same time , You can easily customize it according to your specific needs . In this way ,Prisma Migrate There's a good balance between productivity and control .
Use Prisma Client Intuitive and type safe database access
And Prisma Client The main benefit of using them together is , It allows developers to think in objects , So it provides a familiar and natural way to infer its data .
Prisma Client There is no concept of model instances . contrary , It helps to develop a always return to pure JavaScript Object database query . Thanks to the type of generation , You also get automatic completion for these queries .
in addition , As a pair of TypeScript A reward for developers .Prisma Client All results of the query are fully typed . in fact ,Prisma Provides any TypeScript ORM The most powerful type security guarantee in ( You can read and TypeORM Type security comparison of ).
Prisma Studio Modern management interface
Prisma It also provides a modern management interface for your database -- think about it phpMyAdmin, But in 2021 year .
Prisma It's not about the application you're building , And will be a good complement to your technology stack , Whatever technology you like . You can find more about Prisma Information on how to work with your favorite framework or library .
Prisma There has been a lot of development in the past three years , We are very happy to share the results with the developer community .
Since we started building developer tools , As a company , In the last few years , We have gone through many major product iterations and development processes :
Prisma It's us from being GraphQL The lessons learned by early innovators of ecosystems and the results of insights we have gained from data layers of all sizes, from small start-ups to large businesses .
Since it was first released three years ago ,Prisma It has been used by thousands of companies ,Prisma After the actual test , And ready for mission critical applications .
Prisma It's open development . Our product and engineering teams are monitoring GitHub The problem of , Usually after the question is opened 24 Respond within hours .
The new version is released every two weeks , Contains new features 、bug Repair and a lot of improvement . After every release , We'll all be there Youtube New features on live , And get feedback from the community .
We'll also try to do it through dedicated community support teams , Before the developers put forward about Prisma Any question about , Whether in the Slack,GitHub The forum is still Stackoverflow On , Can help them .
This is the number of our communities :
We are glad to see Prisma How to help companies of all sizes increase productivity and deliver products faster .
In our journey , Adidas 、HyreCar、Agora Systems、Labelbox And other companies provide us with valuable advice on how to develop our products . We are fortunate to work with some of the most innovative and original technology leaders .
If you want to know Prisma How to help these companies increase productivity , Please check out the following resources :
Rapha
iopool
The best developer tools are the ones that go out of the ordinary , And can easily adapt to the increasing complexity of the project . This is exactly what we designed Prisma The way .
Prisma There's a built-in workflow , Applicable to all phases of the development life cycle , From prototyping to development , To deploy , To CI/CD, To testing and so on .
We feel particularly humble , Many framework and library authors choose Prisma As the default of its tools ORM. Here are some uses Prisma The choice of high-level framework :
We are a family of VC Funded companies , Its team is keen to improve the lives of application developers . When we start our journey by building open source tools , We are right. Prisma The long-term vision of is far more than building “ only ” ORM Bigger .
In our recent business activities and Prisma At the party , We started to share that vision , We call it Application data platform .
Prisma Our vision is to make Facebook、Twitter and Airbnb And so on , And make it applicable to development teams and organizations of all sizes .
This idea is mainly influenced by Facebook、Twitter and Airbnb And so on , These companies have built custom data access layers based on their databases and other data sources , Make it easier for application developers to access the data they need in a secure and efficient way .
Prisma The goal is to democratize the idea of this custom data access layer , And make it available to development teams and organizations of any size .
Recent articles
Fan benefits