Early-stage OSS · pin a version in 0.x

Latency budgets for the SQL your Node app actually runs.

queryd is a database query latency detector for Node.js with first-class Prisma support ($queryRaw, $executeRaw, interactive $transaction), sampling, optional EXPLAIN ANALYZE, and pluggable sinks.

Budgets, not vibes

Flag database work that exceeds a latency threshold so regressions surface before users feel them.

Prisma-shaped path

Designed for common Node + ORM setups; the goal is ergonomic hooks instead of hand-rolled timers.

Predictable overhead

Sampling-first design so observability stays cheap enough to leave on in production.

Explain the worst

Optional EXPLAIN pipeline to inspect the slowest offenders when you need depth, not noise.

Usage · Prisma
TypeScript
import { PrismaClient } from "@prisma/client";
import {
  createSlowQueryDetector,
  wrapPrismaClient,
  createConsoleLogger,
  runWithDbContext,
} from "@olegkoval/queryd";

const base = new PrismaClient();
const detector = createSlowQueryDetector(
  { warnThresholdMs: 200, dbName: "primary" },
  { logger: createConsoleLogger() },
);
export const prisma = wrapPrismaClient(base, detector);

await runWithDbContext({ requestId: "req-1", userId: "u-1" }, async () => {
  await prisma.$queryRaw`SELECT 1`;
});

MIT licensed · oleg-koval/slow-query-detector · package name on npm is @olegkoval/queryd