Convert Prisma read queries to SQL and execute via postgres.js or better-sqlite3 for 2-7x performance gain over Prisma Client. Version 1.83.0, actively maintained with weekly releases. Maintains full Prisma API compatibility, generated types, and support for findMany, findFirst, findUnique, count, aggregate, groupBy, and PostgreSQL batch operations. Key differentiator: keeps Prisma's schema, migrations, and types while eliminating query engine runtime overhead for reads.
npm install prisma-sqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows setup: add generator, generate, extend PrismaClient with speedExtension for PostgreSQL, and run a query.
Ensure you still have a standard PrismaClient for writes and unsupported queries.
Chain other $extends calls before speedExtension: prisma.$extends(A).$extends(B).$extends(speedExtension({...})).Import from './generated/sql' after running prisma generate.
Upgrade to Node >=16.
Use postgres.js as the driver when using $batch.
Run 'npx prisma generate' and import from './generated/sql' (adjust relative path based on project structure).
Change import to './generated/sql' (or the actual path to generated outputs).
Use 'as SpeedClient<typeof basePrisma>' after $extends call.
Switch to postgres.js as the database driver for $batch support.