-- v0.3.0 · prisma 7.1+ · postgresql · mysql · sqlite

See every query your Prisma app makes.

The database profiler for Prisma ORM, in development. Every SQL statement of a request, the line of your code that sent it, and a warning the moment an N+1 shows up.

Get started →
TIMELINE · GET /0 ─ 4.9 ms
User.findMany
Post.count
Post.count
Post.count
Post.count
Post.count
Post.count
N+1Post.count, 6 times from app/routes/home.tsx:8
Each bar is one Prisma operation, on the request's own clock. Recorded from the example app.

↓ The bar at the bottom of this page is the real one, on the same sample data. Click it.

[query-profiler] GET / 200 · 7 queries · 3.67 ms in db · 7 operations · 1 warning · 6.6 ms · 3900a9

One line per request in your terminal, too.

-- why

An ORM hides the SQL. We show it back.

Prisma turns one line of TypeScript into several statements, and a loop into a hundred. You find out in production. query-profiler opens a profile for every request in development, records each operation and the SQL it ran, and tells you which line to look at.

-- what it catches

The Warnings tab, before your users find it

-- quick start

Two lines, nothing to remove

Add the Vite plugin and wrap your Prisma client. Nothing goes in your routes, and production builds get empty versions of both, so there is no if (DEV) anywhere.

React Router guide →
import { PrismaPg } from "@prisma/adapter-pg";
import { profilePrisma, withProfiler } from "query-profiler/prisma";

const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL });

export const prisma = profilePrisma(
  new PrismaClient(withProfiler({ adapter })),
);
-- the full profile

Room to read it, at /_profiler

Every recent request with its calls under it, the one you pick with its cards and tabs, and stats across all of them: the slowest statements, the most repeated, time by model and by route.

Query Profiler
GET 200 /productsdocument · 1 query · 1.88 ms
└ /products/offersdata · 2 queries · 3.46 ms
└ /products/purchasesdata · 2 queries · 1.84 ms
GET 200 /document · 7 queries · 1 warning
GET /products 200
5queries
7.2 msin the database
3operations
2calls from this page
Open the live demo →
-- works with

Prisma first. Your framework next.

SELECT logo, name, versions FROM integrations WHERE status = 'ready';
(12 rows)

Find the N+1 before your users do.

Free and open source, MIT licensed.