Prisma ORM 8 is here.Read the docs

Extensions

Every package that plugs into Prisma ORM: database packages, column types, indexes, query operations, and middleware, by Prisma and the community.

An extension is an npm package that adds something Prisma ORM does not do on its own: a column type such as a vector or a geometry, an index type, query operations (new functions you can call in a query, such as pgvector's cosineDistance), or middleware, which runs your own code before and after every query. To use PostgreSQL you install @prisma/orm-postgres, and to use MongoDB you install @prisma/orm-mongo, because support for a database comes from an extension too.

Installing the package is not the whole job, because you register an extension in two places. It goes in prisma.config.ts, so that the command line tools know about it, and in db.ts, the file where you create the client, so that your queries can use what it adds. @prisma/orm-postgres is the package you call directly: ormConfig(...) in prisma.config.ts and postgres(...) in db.ts. Other extensions are listed in the extensions array passed to those two calls. Using extensions shows both registrations, with the install command, for pgvector. Middleware is the exception, because you register it on the client only, and How middleware works covers that.

Your contract is what Prisma ORM 8 calls your schema: contract.prisma in place of schema.prisma. If you have a Prisma ORM 7 project, Coming from Prisma ORM 7 says what replaced schema.prisma, @prisma/client, and $use.

Catalog

The extension directory has the install command and the registration snippet for each entry below. There is no MySQL package, and Supported databases says what is planned. An entry marked experimental works today, but its API can change between releases.

NameWhat it addsPackageDatabasesBy
arktype-jsonJSON columns validated by an arktype schema and typed end to end.@prisma/orm-extension-arktype-jsonPostgreSQLPrisma
Cache middlewareServe repeated reads from an in-memory or pluggable cache, opted in per query.@prisma/orm-extension-middleware-cachePostgreSQL, MongoDBPrisma
MongoDBMongoDB support for Prisma ORM: config, runtime, contract authoring, BSON values, and migrations in one package.@prisma/orm-mongoMongoDBPrisma
ParadeDB (experimental)BM25 full-text search indexes.@prisma/orm-extension-paradedbPostgreSQLPrisma
pgvectorVector columns and similarity search for embeddings.@prisma/orm-extension-pgvectorPostgreSQLPrisma
PostGISGeometry columns and geospatial queries such as distance and containment.@prisma/orm-extension-postgisPostgreSQLPrisma
PostgreSQLPostgreSQL support for Prisma ORM: config, runtime, contract authoring, and migrations in one package.@prisma/orm-postgresPostgreSQLPrisma
SQLite (experimental)SQLite support for Prisma ORM: config, runtime, contract authoring, and migrations in one package.@prisma/orm-sqliteSQLitePrisma
Supabase (experimental)Supabase auth and storage tables plus role-bound clients for row-level security.@prisma/orm-extension-supabasePostgreSQLPrisma
IndexedDB (experimental)Prisma 8 for IndexedDB: a browser database from your PSL schema, with typed accessors and explicit migrations.@prisma-idb/client-idbIndexedDBYash Kolekar
typed-jsonTyped JSON and text columns with no validator dependency.prisma-orm-extension-typed-jsonPostgreSQLOmar Dulaimi
zod-jsonTyped JSON columns described and enforced by a zod schema.prisma-orm-extension-zod-jsonPostgreSQLOmar Dulaimi

In the Supabase row, role-bound clients are client instances pinned to a particular PostgreSQL role, so the database applies that role's row-level security policies to whatever you query through them.

Publish your own

An extension you write yourself is an npm package with one entry point for the command line tools and one for your application. Name your two entry points control and runtime, as pgvector does and as the call for extension authors describes. Middleware ships a single entry point instead, because it is only ever registered on the client.

To write middleware, follow Authoring custom middleware. If you are adding a whole database, @prisma/orm-postgres is the one to copy for a SQL database and @prisma/orm-mongo for a document database. Once your package is on npm, submit it to the directory, and a maintainer reviews your entry before it appears in the catalog.

See also

On this page