Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

On this pageOverview

Data sources (Prisma ORM v7) (/docs/orm/v7/prisma-schema/overview/data-sources)

For the complete Prisma documentation index, see llms.txt. A markdown version of any docs page is available by appending .md to its URL.

Data sources enable Prisma to connect to your database. This page explains how to configure data sources in your Prisma schema

Location: ORM > v7 > Prisma Schema > Overview > Data sources

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:

prisma
datasource db {
  provider = "postgresql"
}

A Prisma schema can only have one data source. However, you can:

Some data source providers allow you to configure your connection with SSL/TLS by specifying certificate locations in your connection configuration.

See the database-specific documentation above for examples of SSL/TLS connection configuration in Prisma Config.

  • 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
  • Schema location: Documentation regarding proper location of Prisma Schema including default naming and multiple files.
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu