# Prisma ORM (/docs/orm) > For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL. Prisma ORM is a typed data layer for TypeScript, with typed queries and migrations for PostgreSQL, MongoDB, and SQLite. Location: Prisma ORM Prisma ORM is the library your TypeScript app uses to read and write its database. You describe your data in a contract, which is the file that holds your models, and Prisma ORM gives you typed queries and migrations for it. If you know Prisma ORM 7, the contract takes the place of `schema.prisma`, and the queries have a new shape, which the example below shows. Prisma ORM 8 is a release candidate, not yet a final release, and it is what `npm install prisma` gives you today. It supports PostgreSQL. MongoDB is in early access, so some of what works on PostgreSQL is missing on it. SQLite ships as an experimental package, `@prisma/orm-sqlite`. MySQL, SQL Server, and CockroachDB come later, and until then Prisma ORM 7 supports them. [Supported databases](https://www.prisma.io/docs/orm/supported-databases) says what early access and experimental mean, and what works on each database. Here is a contract with two models, a query that reads them, and what the query prints against a database that holds two users and two posts. The first line of the contract, `// use prisma-8`, is required, and the setup commands write it for you. `db` is exported from `src/prisma/db.ts`, which reads `DATABASE_URL` and creates the client. For a new app, `npm create prisma@latest` writes both files. For an app you already have, `npx prisma@latest orm init` writes them. Run the query file with `npx tsx index.ts`, after a page under "Start here" has created the tables. ```prisma title="src/prisma/contract.prisma" // use prisma-8 model User { id Int @id @default(autoincrement()) email String @unique name String? posts Post[] } model Post { id Int @id @default(autoincrement()) title String author User @relation(fields: [authorId], references: [id]) authorId Int } ``` ```typescript title="index.ts" import { db } from "./src/prisma/db"; const users = await db.orm.public.User.include("posts").all(); console.dir(users, { depth: null }); await db.close(); ``` ```text title="Output" no-copy [ { email: 'alice@example.com', id: 1, name: 'Alice', posts: [ { authorId: 1, id: 1, title: 'Hello, world' }, { authorId: 1, id: 2, title: 'Second post' } ] }, { email: 'bob@example.com', id: 2, name: 'Bob', posts: [] } ] ``` Every field in the result is typed from the contract, down to each post's `title`. `db.orm` holds the typed queries for your models, and `public` is the PostgreSQL schema the table is in, which is the default one unless you created another. After you change the contract, run `npx prisma contract emit`. It replaces `prisma generate`, and there is no `@prisma/client` package: your code imports `db` from `src/prisma/db.ts`. ## Start here [#start-here] Pick the page that matches where you are starting from. Each page uses PostgreSQL and links its MongoDB version. - [I'm creating a new app](https://www.prisma.io/docs/prisma-orm/quickstart/postgresql): Create an app from a template and run your first query. - [I have an app, but no database yet](https://www.prisma.io/docs/prisma-orm/quickstart/existing-app/postgresql): Add Prisma ORM to your app, create the tables, and apply your first migration. - [I have a database already](https://www.prisma.io/docs/prisma-orm/add-to-existing-project/postgresql): Write the contract from the tables you have, then make your first change to the tables as a migration. - [I have a Prisma 7 app](https://www.prisma.io/docs/guides/upgrade-prisma-orm/postgresql): Install Prisma ORM 8 next to Prisma ORM 7 in the same app, against the same database, and move one part of the app at a time. ## What you can do with Prisma ORM [#what-you-can-do-with-prisma-orm] * [Model your data](https://www.prisma.io/docs/orm/data-modeling): describe your models, their fields, and how they relate to each other. * [Read and write data](https://www.prisma.io/docs/orm/fundamentals/reading-data): fetch, filter, sort, and paginate records, then create, update, and delete them. * [Query relations](https://www.prisma.io/docs/orm/fundamentals/relations-and-joins): read related records in the same query with `.include(...)`. * [Run transactions](https://www.prisma.io/docs/orm/fundamentals/transactions): make several writes succeed or fail together. * [Migrate your database](https://www.prisma.io/docs/orm/migrations/how-migrations-work): after you change the contract and run `npx prisma contract emit`, `npx prisma migration plan` writes the migration for you to review. `npx prisma db migrate --advance-ref db` then applies it to your development database and records that it did, so the next plan starts from there. The two commands take the place of `prisma migrate dev`. * [Add middleware](https://www.prisma.io/docs/orm/middleware/how-middleware-works): run your own code before and after every query, for example to log each query. It takes the place of both `$use` and `$extends`. * [Use extensions](https://www.prisma.io/docs/orm/extensions/using-extensions): add PostgreSQL features such as vector search, geospatial data, and full-text search. These are database extensions, not the `$extends` of Prisma ORM 7. * [Use the CLI](https://www.prisma.io/docs/cli): run the `npx prisma` commands for your contract, your database, and your migrations. ## Coming from Prisma ORM 7 [#coming-from-prisma-orm-7] [Coming from Prisma ORM 7](https://www.prisma.io/docs/orm/coming-from-prisma-orm-7) is a lookup table: what each Prisma ORM 7 schema attribute, command, and query is called in Prisma ORM 8. To move a running app, follow "I have a Prisma 7 app" above instead, and use the table while you do. ## Release status [#release-status] `npm install prisma` gives you Prisma ORM 8 today. If your app is on Prisma ORM 7 and you want to stay there, lock `prisma` and `@prisma/client` to version 7 in `package.json`, as [Release status](https://www.prisma.io/docs/orm/release-status) shows. That page also has the date of the final release and how long Prisma ORM 7 stays supported after it. ## Related pages - [`Choose a Prisma ORM setup path`](https://www.prisma.io/docs/getting-started): Choose the fastest path to try Prisma ORM in a new or existing project. - [`Console`](https://www.prisma.io/docs/console): Learn how to use the Console to manage and integrate Prisma products into your application. - [`Introduction to Prisma ORM`](https://www.prisma.io/docs/prisma-orm): Prisma ORM 8 is the current release. - [`Local development`](https://www.prisma.io/docs/local-development): Run the whole Prisma stack on your machine, with your app on Bun, a local Prisma Postgres database, and local object storage. - [`Overview`](https://www.prisma.io/docs/cli): Prisma CLI reference