How to use Prisma ORM with multiple database schemas
warning
Multiple database schema support is currently available with the PostgreSQL, CockroachDB, and SQL Server connectors.
Many database providers allow you to organize database tables into named groups. You can use this to make the logical structure of the data model easier to understand, or to avoid naming collisions between tables.
In PostgreSQL, CockroachDB, and SQL Server, these groups are known as schemas. We will refer to them as database schemas to distinguish them from Prisma ORM's own schema.
This guide explains how to:
- include multiple database schemas in your Prisma schema
- apply your schema changes to your database with Prisma Migrate and
db push
- introspect an existing database with multiple database schemas
- query across multiple database schemas with Prisma Client