Easy database access in Express servers
Build high-performance and type-safe Express servers with Prisma's developer-friendly database tools: The world's most popular TypeScript ORM and the first serverless database without cold starts.
Why Express and Prisma?
Built for high-performance web apps
Built on unikernels, Prisma Postgres runs on bare metal servers for peak performance and infinite scalability.
Middleware-friendly
Prisma integrates seamlessly with Express's middleware pattern, making it easy to add database operations to your request processing pipeline.
Serverless, without cold starts
The first serverless database with pay-as-you-go pricing, no infrastructure management, and zero cold starts.
Built-in global caching
Add a cache strategy to any database query and its results will be cached close to your users for peak performance and UX.
Helpful communities
Both Express and Prisma have vibrant communities where you find support, fun events and amazing developers.
Lightweight & flexible architecture
Express's minimalist approach pairs perfectly with Prisma's focused database toolkit, giving you a lean stack that's powerful without unnecessary bloat.
How Prisma and Express fit together
Basic CRUD Routes
Prisma simplifies building REST APIs in Express by providing an intuitive and type-safe way of sending queries. Instead of writing raw SQL, you can create, read, update, and delete records with JavaScript methods that map directly to your schema.
This approach reduces boilerplate while giving you full type safety and autocompletion in your editor.
// src/routes/users.ts
import express from 'express';
import { PrismaPg } from '@prisma/adapter-pg';
import { PrismaClient } from '../generated/client';
const router = express.Router();
const adapter = new PrismaPg({
connectionString: process.env.DATABASE_URL,
});
const prisma = new PrismaClient({ adapter });
router.get('/', async (req, res) => {
const users = await prisma.user.findMany();
res.json(users);
});
router.post('/', async (req, res) => {
const { name, email } = req.body;
const newUser = await prisma.user.create({ data: { name, email } });
res.status(201).json(newUser);
});
export default router;Featured Prisma & Express community examples
Express & Prisma ORM Starter Kit
A ready-to-run example project for a REST API with Prisma ORM.
Master Prisma ORM in Express: Step by Step Video Tutorial
Learn how to integrate Prisma ORM in an Express app in this step-by-step video tutorial.
How to Build a REST API with Prisma and PostgreSQL
A comprehensive tutorial for building REST APIs with Express, Prisma and PostgreSQL.
