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

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

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

A data source determines how Prisma ORM connects to your database, and is represented by the [`datasource`](/guides/reference-6-v6-reference-prisma-schema-reference#datasource) block in the Prisma schema. The following data source uses the `postgresql` provider and includes a connection URL:

> \[!NOTE]
> As of Prisma ORM v7, the `url`, `directUrl`, and `shadowDatabaseUrl` fields in the Prisma schema `datasource` block are deprecated. Configure these fields in [Prisma Config](/guides/reference-6-v6-reference-prisma-config-reference) instead.

```prisma
datasource db {
  provider = "postgresql"
  url      = "postgresql://johndoe:mypassword@localhost:5432/mydb?schema=public"
}
```

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

- [Programmatically override a data source `url` when creating your `PrismaClient`](/guides/reference-6-v6-reference-prisma-client-reference#programmatically-override-a-datasource-url)
- [Specify a different URL for Prisma Migrate's shadow database if you are working with cloud-hosted development databases](/guides/prisma-migrate-v6-understanding-prisma-migrate-shadow-database#cloud-hosted-shadow-databases-must-be-created-manually)

> **Note**: Multiple provider support was removed in 2.22.0. Please see [Deprecation of provider array notation](https://github.com/prisma/orm/issues/3834) for more information.

## Securing database connections

Some data source `provider`s allow you to configure your connection with SSL/TLS, and provide parameters for the `url` to specify the location of certificates.

- [Configuring an SSL connection with PostgreSQL](/guides/core-concepts-v6-overview-databases-postgresql#configuring-an-ssl-connection)
- [Configuring an SSL connection with MySQL](/guides/core-concepts-v6-overview-databases-mysql#configuring-an-ssl-connection)
- [Configure a TLS connection with Microsoft SQL Server](/guides/core-concepts-v6-overview-databases-sql-server#connection-details)

Prisma ORM resolves SSL certificates relative to the `./prisma` directory. If your certificate files are located outside that directory, e.g. your project root directory, use relative paths for certificates:

> \[!NOTE]
> When you're using a [multi-file Prisma schema](/guides/prisma-schema-v6-overview-location#multi-file-prisma-schema), Prisma ORM resolves SSL certificates relative to the `./prisma/schema` directory.

```prisma
datasource db {
  provider = "postgresql"
  url      = "postgresql://johndoe:mypassword@localhost:5432/mydb?schema=public&sslmode=require&sslcert=../server-ca.pem&sslidentity=../client-identity.p12&sslpassword=<REDACTED>"
}
```

## Related pages

- [`Generators`](/guides/prisma-schema-v6-overview-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`](/guides/prisma-schema-v6-overview-location): Documentation regarding proper location of Prisma Schema including default naming and multiple files.

## Related pages

- [Authentication & Tools](./authentication-tools-index.md)
- [Build](./build-index.md)
- [Changelog](../changelog.md)
- [Concepts](./concepts-index.md)
- [Console commands](./console-commands-index.md)
- [Contract Authoring](./contract-authoring-index.md)
- [Core Concepts](./core-concepts-index.md)
- [Data Modeling](./data-modeling-index.md)
- [Database](./database-index.md)
- [DB commands](./db-commands-index.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
