Generated banner for Prisma Orm Setup
Generated logo for Prisma Orm Setup

Prisma Orm Setup

PrismaOfficialCreated by prisma

  • Skill
  • Tool integration
  • Software development
  • MIT
  • No issues found

From the author

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.
— the description by prisma

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured approach to managing Prisma ORM installations. It identifies the existing ORM version and database provider to ensure compatibility, defaulting new projects to Prisma 8 while preserving legacy configurations for versions 6 and 7. It handles initialization, connection verification, and provides guidance on loading version-specific instructions.

What it does

  • Detects the current Prisma ORM version and database provider in an existing project.
  • Bootstraps new applications with Prisma ORM 8.
  • Provides setup and connection repair paths for Prisma 6 and 7.
  • Synchronizes and loads version-specific guidance for Prisma 8.
  • Verifies database connectivity using read-only queries.
  • Ensures environment variables and connection strings are handled securely.

When to use it

  • When initializing a new project with Prisma ORM.
  • When troubleshooting database connection issues in an existing Prisma application.
  • When you need to identify the specific Prisma ORM version currently in use.
  • When setting up a project that requires a specific legacy version of Prisma ORM.

Advantages

  • Prevents accidental version mismatches by detecting existing configurations.
  • Maintains compatibility by respecting legacy provider and runtime requirements.
  • Integrates with package-owned guidance for up-to-date Prisma 8 instructions.
  • Promotes secure credential management by using environment files.

Usage examples

“Set up a new Prisma 8 project with PostgreSQL.”
The agent will initialize a new Prisma 8 project, configure the schema for PostgreSQL, and verify the installation.
“I am having trouble connecting my Prisma 7 app to my database.”
The agent will inspect the existing Prisma 7 configuration and provide steps to diagnose and repair the connection.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/prisma/prisma-orm-setup/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip prisma-orm-setup.zip -d .agents/skills

Documentation by prisma

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 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 pointPath
Prisma 8 applicationStep 4, without reinitializing
New application without a version choiceStep 3
Prisma 6 or 7 application, or an explicit earlier majorStep 5

For a new application, check the selected Prisma 8 release's provider support 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; for MongoDB 6-to-8, use prisma-mongodb-upgrade. 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 and initialization guide. 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:

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:

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.

  • Prisma 6 MongoDB: use MongoDB setup. 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; do not copy the Prisma 7 configuration or adapter examples into it.

DatabaseReference
PostgreSQLPostgreSQL
MySQL / MariaDB / PlanetScaleMySQL
SQLite / TursoSQLite
Microsoft SQL Server / Azure SQLSQL Server
CockroachDBCockroachDB
MongoDB / Atlas on Prisma 6MongoDB
Prisma Postgres with Prisma 7Prisma Postgres

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.

Files

references/v7-sqlserver.md

SQL Server Setup

Configure Prisma ORM 7 with SQL Server. For an existing Prisma 6 app, keep its configuration and use the Prisma 6 docs; the configuration and adapter examples below are for 7.

Prerequisites

  • SQL Server 2017, 2019, 2022, or Azure SQL

  • TCP/IP enabled

1. Schema Configuration

In prisma/schema.prisma:

datasource db {
  provider = "sqlserver"
}

generator client {
  provider = "prisma-client"
  output   = "../generated"
}

2. Config Configuration

In prisma.config.ts:

import 'dotenv/config'
import { defineConfig, env } from 'prisma/config'

export default defineConfig({
  schema: 'prisma/schema.prisma',
  datasource: {
    url: env('DATABASE_URL'),
  },
})

3. Environment Variable

In .env:

DATABASE_URL="sqlserver://localhost:1433;database=mydb;user=sa;password=Password123;encrypt=true;trustServerCertificate=true"
Connection String Format
sqlserver://HOST:PORT;database=DB;user=USER;password=PASS;encrypt=true;trustServerCertificate=true
  • encrypt: Required for Azure (true).

  • trustServerCertificate: True for self-signed certs (local dev).

Driver Adapter

Use a driver adapter for the standard SQL workflow.

  1. Install adapter and driver:

    npm install @prisma/adapter-mssql@7 mssql
  2. Set SQLSERVER_USER and SQLSERVER_PASSWORD in the application environment to match the CLI URL, and use the same server, port, database, and TLS options. The following example is for local development with a self-signed certificate; use certificate verification for hosted databases. Instantiate Prisma Client with the adapter:

    import 'dotenv/config'
    import { PrismaClient } from '../generated/client'
    import { PrismaMssql } from '@prisma/adapter-mssql'
    
    const adapter = new PrismaMssql({
      server: 'localhost',
      port: 1433,
      database: 'mydb',
      user: process.env.SQLSERVER_USER,
      password: process.env.SQLSERVER_PASSWORD,
      options: {
        encrypt: true,
        trustServerCertificate: true,
      },
    })
    
    const prisma = new PrismaClient({ adapter })

Common Issues

"Login failed for user"
  • SQL Server auth vs Windows auth. Prisma typically uses SQL Server authentication (username/password).

  • Ensure TCP/IP is enabled in SQL Server Configuration Manager.

"Table not found" (dbo schema)

Check that the connection URL's schema parameter (normally dbo) matches the intended schema. Preserve an existing multi-schema configuration and model mappings.

References

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
prisma
Publisher
Prisma (Official)
Source
prisma/skills · prisma-orm-setup · commit 8ea289b
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by prisma or Prisma.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download prisma-orm-setup.zip