← Explore all skills

DATABASES / Prisma

Prisma ORM Setup

Guides configuring Prisma ORM across PostgreSQL, MySQL, SQLite, SQL Server, CockroachDB, MongoDB, and Prisma Postgres.

“Set up Prisma ORM in an application, connect its database, or troubleshoot the connection of an existing Prisma 6, 7, or 8 app. Defaults new applications to Prisma ORM 8 and loads the package-owned prisma-8 skill; keeps existing Prisma 6/7 apps on their version with provider references for PostgreSQL, MySQL, SQLite, SQL Server, CockroachDB, MongoDB, and Prisma Postgres.”

01 / THE REASONING

Why this made the selection.

  • Configures provider-specific datasource blocks and connection string arguments across 7 distinct database engines without conflating parameters.
  • Directs configuration bootstrapping through prisma.config.ts with explicit dotenv loading and migration tracking directories.

02 / THE REVIEW RECORD

What we actually inspected.

Source review has boundaries.
A clear record is more useful than a “safe” badge.

Material inspected

  • prisma-orm-setup/SKILL.md
  • LICENSE

Our findings

  • License is confirmed MIT: Copyright (c) 2025 Prisma.
  • Schema generator definitions clearly separate client output path conventions for ESM vs CJS packaging.
  • The definition distinguishes new Prisma 8 setup, major-upgrade routing, legacy setup and connection repair, warning that CLI version alone is insufficient.
  • Step 4 runs prisma skills sync and then requires a read of the synced prisma-8 skill; sync alone is not completion.

Not established by this review

  • npx prisma init and prisma migrate dev commands were not executed.
  • Live database connections were not established.
  • Not executed: it was not installed or run.

The review applies to the material and revision named here. A newer upstream release can change its behavior.

03 / PUT IT TO WORK

Add a skill to your workflow.

Upstream setup instructions ↗

DOCUMENTED COMMAND

npx skills add prisma/skills/prisma-orm-setup

Run in your terminal to choose your AI tools, project or global scope, and installation method. This short command follows the current upstream version; the review covers the revision shown above.

Optional: install the reviewed revision

Keeps the original source and installer version where recorded, while leaving your AI tools and installation scope for you to choose.

npx skills add https://github.com/prisma/skills/tree/be16a8740d01363d13552b317042431ee8dfc581/prisma-orm-setup
  1. Add the skill using the pinned npx command.
  2. The publisher README lists npx skills add prisma/skills --skill prisma-orm-setup, which does not pin revision be16a8740d01363d13552b317042431ee8dfc581.
  3. Pin Prisma packages to the intended major, as steps 3 and 5 of the file require.
  4. For manual installation instead, download the complete bundle from https://undominated.ai/resources/skills/prisma-orm-setup/bundle.zip and extract it into a new directory. It holds SKILL.md and 8 supporting files unchanged at revision be16a874, the upstream licence and an attribution file.
  5. Place the extracted directory in your host's documented skills directory, named prisma-orm-setup. Keep SKILL.md and the licence together.

Before you start

  • Node.js and npm for the documented Skills installer
  • The application's package manifest, lockfile and Prisma schema
  • Target database instance or URL

THE COMPLETE REVIEWED DEFINITION

Read it before you reuse it.

Original source bytes, with attribution.
Review the host-specific setup notes above.

---
name: prisma-orm-setup
description: Set up Prisma ORM in an application, connect its database, or troubleshoot the connection of an existing Prisma 6, 7, or 8 app. Defaults new applications to Prisma ORM 8 and loads the package-owned prisma-8 skill; keeps existing Prisma 6/7 apps on their version with provider references for PostgreSQL, MySQL, SQLite, SQL Server, CockroachDB, MongoDB, and Prisma Postgres.
license: MIT
metadata:
  author: prisma
  version: "1.0.0"
---

# Prisma ORM setup

This skill owns ORM version selection for setup and connection work. Preserve the application's ORM version and intended database. A connection repair does not require a major upgrade.

New applications default to **Prisma ORM 8**. Detailed Prisma 8 configuration, queries, migrations, and runtime code belong to the versioned [prisma-8 skill](https://github.com/prisma/orm/tree/main/skills/prisma-8) shipped with the ORM package.

## 1. Detect the starting point

Read the package manifest, lockfile, Prisma configuration, schema, and application imports. Identify the ORM version, database provider, and runtime. The CLI version alone does not identify the application's version: a Prisma 8 CLI can coexist with a legacy client, so inspect `@prisma/client`, `@prisma/prisma7`, and the schema and configuration.

| Starting point                                          | Path                                                     |
| ------------------------------------------------------- | -------------------------------------------------------- |
| Prisma 8 application                                    | Step 4, without reinitializing                           |
| New application without a version choice                | Step 3                                                   |
| Prisma 6 or 7 application, or an explicit earlier major | [Step 5](#5-set-up-or-repair-an-earlier-version)         |

For a new application, check the selected Prisma 8 release's [provider support](https://www.prisma.io/docs/orm/supported-databases) and runtime requirements before installing. If the provider is unsupported, explain the limitation and offer an explicitly selected earlier version. Keep the requested database; do not silently fall back or invent a supported target.

Use an existing database when supplied. Load `prisma-postgres-setup` only when Prisma Postgres is needed and no connection has been selected yet; return here once connected.

## 2. Handle requested major upgrades separately

When the user requests a major upgrade, load a workflow that supports the source version and provider. For PostgreSQL 7-to-8, use the [Prisma migration guide](https://www.prisma.io/docs/guides/upgrade-prisma-orm/postgresql); for MongoDB 6-to-8, use [prisma-mongodb-upgrade](../prisma-mongodb-upgrade/SKILL.md). Other providers need an explicitly supported migration path. `prisma-upgrade-v7` covers **6 to 7**; the package-owned `prisma-8` upgrade reference covers updates within 8.

## 3. Bootstrap a new Prisma 8 application

Check the selected release's [runtime requirements](https://www.prisma.io/docs/orm/release-status) and [initialization guide](https://www.prisma.io/docs/cli/orm-init). Resolve and pin a published Prisma CLI **8** release, including its prerelease suffix if needed; verify its version before initialization. Do not rely on a floating `latest` remaining version 8.

Use the project's package manager to run the installed CLI. For PostgreSQL and Prisma schema language authoring:

```bash
prisma orm init --yes --target postgres --authoring psl
```

Use the supported target for the selected provider. Preserve existing application files and connection configuration; do not let setup provision an unrelated database. Verify that the resolved ORM package is version 8 before proceeding.

## 4. Load the installed Prisma 8 guidance

Run the installed CLI through the project's package manager:

```bash
prisma skills sync
```

Then **read** the synced `prisma-8/SKILL.md`, for example `.agents/skills/prisma-8/SKILL.md`, and follow its preconditions and selected references. Syncing alone does not load the instructions. If the package-owned guidance cannot be loaded, report the blocker. Continue with step 6.

## 5. Set up or repair an earlier version

For a new setup that explicitly selects an earlier version, pin packages to that major and use its runtime requirements. Keep the CLI, client, and SQL adapter releases compatible. Existing dependencies need not change for a connection repair.

- **Prisma 7 SQL:** use the provider reference below and [client setup](references/v7-client-setup.md).
- **Prisma 6 MongoDB:** use [MongoDB setup](references/v6-mongodb.md). SQL driver adapters do not apply.
- **Prisma 6 SQL:** preserve its generator, schema URL, and client initialization. Use the provider's connection details below and the [Prisma 6 documentation](https://www.prisma.io/docs/orm/v6); do not copy the Prisma 7 configuration or adapter examples into it.

| Database                         | Reference                                                 |
| -------------------------------- | --------------------------------------------------------- |
| PostgreSQL                       | [PostgreSQL](references/v7-postgresql.md)                 |
| MySQL / MariaDB / PlanetScale    | [MySQL](references/v7-mysql.md)                           |
| SQLite / Turso                   | [SQLite](references/v7-sqlite.md)                         |
| Microsoft SQL Server / Azure SQL | [SQL Server](references/v7-sqlserver.md)                  |
| CockroachDB                      | [CockroachDB](references/v7-cockroachdb.md)               |
| MongoDB / Atlas on Prisma 6      | [MongoDB](references/v6-mongodb.md)                       |
| Prisma Postgres with Prisma 7    | [Prisma Postgres](references/v7-prisma-postgres.md)       |

The Prisma 7 SQL examples were verified with Prisma 7.10.0; the MongoDB examples with Prisma 6.19.3.

## 6. Connect and verify

The CLI and the application can load different environment files. Load the intended environment for each without printing secrets, and keep credentials in ignored environment files or the host's secret configuration. For SQL adapters, make the adapter's runtime options address the same database as the CLI connection URL.

For an existing app, preserve schema, migrations, and generator configuration unless the requested work requires changes. Diagnose the connection before running schema-changing commands.

Run the project's relevant checks and a read-only query through the application's client against the intended database. Report the ORM version, the loaded `prisma-8` skill version where applicable, and the query result. Package installation or a successful skill sync alone is not a completed setup.

The download contains SKILL.md. Extract the whole bundle; the supporting files are required. Inspect the included MANIFEST.json for file hashes.

By Prisma. Exact upstream source ↗ · Licence · Attribution

SHA-256 e310619d4d1c81f4288d16e01d5476d0524b249245bba4ca41ec679cddaeff3c

Read the applicable licence
MIT License

Copyright (c) 2025 Prisma

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

04 / FOLLOW THE EVIDENCE

The source trail.

Our notes are separate from the original resource.
Check upstream before adopting a new version.

  1. https://github.com/prisma/skills/blob/be16a8740d01363d13552b317042431ee8dfc581/prisma-orm-setup/SKILL.md

    Supports: summary, whySelected, bestFor, limitations

  2. https://github.com/prisma/skills/blob/be16a8740d01363d13552b317042431ee8dfc581/LICENSE

    Supports: license

  3. https://raw.githubusercontent.com/prisma/skills/be16a8740d01363d13552b317042431ee8dfc581/prisma-orm-setup/SKILL.md

    Supports: bestFor, review.notTested, review.reviewedAt

Evidence & Ask