Member-only story

Benchmark Prisma ORM in NextJS

Bekhzod Ismoiliy
5 min readAug 31, 2024

--

Check with push, pull, and drop

Let’s get started!

Photo by Ahsan Avi on Unsplash

Let's begin with creating a folder, as I use WSL2 with Ubuntu. I will use the terminal.

mkdir test-prisma-orm

Open up the VSCode and it’s terminal

npx create-next-app@latest ./

Make sure that you have the Docker, cause we will use it.

docker

Let’s create the docker-compose.yml for running the Postgresql inside the container. Be careful, I use another port for the reason the 5432 is allocated in my machine. We will use 5433.

version: "3.8"
services:
db:
image: postgres:latest
container_name: nextjs_prisma_postgres
environment:
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
POSTGRES_DB: mydatabase
ports:
- "5433:5432"
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- db-network

volumes:
pgdata:

networks:
db-network:

Let’s create the .env file

DATABASE_URL="postgresql://myuser:mypassword@localhost:5433/mydatabase?schema=public"

The rest is as simple as possible. For convenience, I will use yarn package manager, you can use whatever package you want.

--

--

Bekhzod Ismoiliy
Bekhzod Ismoiliy

Written by Bekhzod Ismoiliy

I am a highly skilled and dedicated Frontend Web Developer with a passion for creating exceptional user experiences.

Responses (1)