> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leap.new/llms.txt
> Use this file to discover all available pages before exploring further.

# Prisma ORM

> Instructions for using Prisma ORM in Leap

Leap makes it easy to use ORMs like [Prisma](https://www.prisma.io/orm). Just describe your data design, and Leap generates the integration.

## How it works

1. **Describe your data layer** in a prompt, including the specifics from the example prompt below
2. **Leap generates the integration**
3. **On build** Prisma generates migration files and Leap generates the database client

<Info> **LLM results vary**, but we've had success getting Prisma set up and working on the first try—including schema definitions, client imports, and connection handling. </Info>

## Example prompt

```
Each Encore service must import the db and create its own instance of a PrismaClient, e.g:
import db from "../dbs/main";
import { PrismaClient } from "../dbs/main/gen/client";
export const prisma = new PrismaClient({ datasources: { db: {url: db.connectionString}}});
Migration files will be automatically generated by Prisma on build.
The client will be automatically generated on build and placed in the ./main/gen/client module
```
