Data sources
Data sources enable Prisma to connect to your database. This page explains how to configure data sources in your Prisma schema
A data source determines how Prisma ORM connects to your database, and is represented by the datasource block in the Prisma schema. Connection details (such as the database URL) are configured in Prisma Config. The following data source uses the postgresql provider:
datasource db {
provider = "postgresql"
}A Prisma schema can only have one data source. However, you can:
- Override the database connection when creating your
PrismaClient - Specify a different database for Prisma Migrate's shadow database if you are working with cloud-hosted development databases
Securing database connections
Some data source providers allow you to configure your connection with SSL/TLS by specifying certificate locations in your connection configuration.
- Configuring an SSL connection with PostgreSQL
- Configuring an SSL connection with MySQL
- Configure a TLS connection with Microsoft SQL Server
See the database-specific documentation above for examples of SSL/TLS connection configuration in Prisma Config.
Overview of Prisma Schema
The Prisma schema is the main method of configuration when using Prisma. It is typically called schema.prisma and contains your database connection and data model
Generators
Generators in your Prisma schema specify what assets are generated when the `prisma generate` command is invoked. This page explains how to configure generators