Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .github/workflows/config/.linkspector.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/linkspector.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/lychee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
--exclude 'http://localhost.*'
--exclude 'https://localhost.*'
--exclude 'https://cockroachlabs.com'
--exclude 'https://www.gnu.org'
--exclude '^/.*'
'./**/*.md' './**/*.mdx'
workingDirectory: "content"
Expand All @@ -60,6 +61,7 @@ jobs:
--exclude 'http://localhost.*'
--exclude 'https://localhost.*'
--exclude 'https://cockroachlabs.com'
--exclude 'https://www.gnu.org'
--exclude '^/.*'
'./**/*.md' './**/*.mdx'
workingDirectory: "content"
Expand Down Expand Up @@ -97,7 +99,7 @@ jobs:
fi

- name: 📝 Comment Broken Links
if: ${{ always() && github.event.pull_request.head.repo.fork == false }}
if: ${{ always() && github.event.pull_request.head.repo.fork == false && (steps.lychee.outputs.exit_code != 0 || (steps.lychee-retry.conclusion != 'skipped' && steps.lychee-retry.outputs.exit_code != 0)) }}
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
Expand Down
229 changes: 98 additions & 131 deletions content/100-getting-started/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ title: 'Get Started'
metaTitle: 'Get started with Prisma'
metaDescription: 'Build data-driven applications with ease using Prisma ORM, add connection pooling or global caching with Prisma Accelerate.'
hide_title: true
tocDepth: 1
sidebar_position: 0
sidebar_class_name: firstTitle
pagination_next: 'getting-started/quickstart-sqlite'
Expand All @@ -18,82 +17,60 @@ import {
Grid,
LinkCard,
List,
Plus,
Plug,
SignalStream,
PrismaPostgres,
SquareLogo,
QuickstartLinkCard
} from '@site/src/components/GettingStarted';


<BoxTitle>Getting started</BoxTitle>

<BorderBox>

<BoxTitle>Get started</BoxTitle>

Welcome 👋

Explore our products that make it easy to build and scale data-driven applications:

[**<Database />Prisma ORM**](/orm/overview/introduction/what-is-prisma) is a next-generation Node.js and TypeScript ORM that unlocks a new level of developer experience when working with databases thanks to its intuitive data model, automated migrations, type-safety & auto-completion.

[**<PrismaPostgres />Prisma Postgres**](/postgres) is a managed PostgreSQL service that gives you an _always-on_ database with _pay-as-you-go_ pricing.

[**<Inspect />Prisma Optimize**](/optimize/) helps you analyze queries, generate insights, and provides recommendations to make your database queries faster.
<List>

[**<Bolt />Prisma Accelerate**](/accelerate) is a global database cache with scalable connection pooling to make your queries fast.
<BorderBox>

</BorderBox>
[**Prisma ORM**](/orm/overview/introduction/what-is-prisma) is an open-source ORM that provides fast, type-safe access to Postgres, MySQL, SQLite, and more databases, and runs smoothly across Node.js, Bun, and Deno.

```terminal
npx prisma init --db
```
</BorderBox >


## <Database color="#5A67D8" width="21" height="24" /> Prisma ORM
<BorderBox>

Add Prisma ORM to your application in a few minutes to start modeling your data, run schema migrations and query your database.
[**Prisma Postgres**](/postgres) is a fully managed PostgreSQL database that scales to zero, integrates with Prisma ORM and Prisma Studio, and includes a generous free tier.

### The easiest way to get started with Prisma
```terminal
npx create-db
```
</BorderBox >

</List>

_Explore all Prisma products at once._
<br/>

<LinkCard
icon="fa-solid fa-rabbit-running"
title="Prisma Starter Template"
desc="Create a new database, model your data, run migrations, and send queries in this comprehensive 5 minute tutorial."
<QuickstartLinkCard
title="Quickstart →"
highlight="#16A394"
link="/getting-started/quickstart-prismaPostgres"
/>
>

### Explore quickly with a SQLite database
The fastest way to set up **Prisma ORM** with a ready-to-use **Prisma Postgres** database.

_These options don't require you to have your own database running._
</QuickstartLinkCard>

<Grid>
<LinkCard
icon="fa-solid fa-rabbit-running"
title="Quickstart"
desc="Set up Prisma ORM from scratch with a SQLite database in 5 minutes."
link="/getting-started/quickstart-sqlite"
/>
<LinkCard
icon="fa-brands fa-github"
title="Examples"
desc="Explore our ready-to-run examples with your favorite frameworks and libraries."
link="https://github.com/prisma/prisma-examples/"
/>
</Grid>
<br/>
<br/>

### Choose an option to get started with your own database
### <PrismaPostgres color="#16A394" width="24" height="24" /> Already have your own database?

_Select one of these options if you want to connect Prisma ORM to your own database._
The fastest way to set Prisma ORM up with a ready-to-use database.

<TabbedContent>
<TabItem value="New database">
<p>
Set up Prisma ORM <b>from scratch</b> with your favorite database and
learn basic workflows like data modeling, querying, and migrations.
</p>
<List>
<SquareLogo
url="/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-prismaPostgres"
image={'/img/technologies/prismaPostgres.svg'}
tech="Prisma Postgres"
/>
<List>
<SquareLogo
url="/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-postgresql"
image={'/img/technologies/postgresqlsimple.svg'}
Expand All @@ -120,96 +97,86 @@ _Select one of these options if you want to connect Prisma ORM to your own datab
image={'/img/technologies/cockroachdbdark.svg'}
tech="Cockroach DB"
/>
<SquareLogo
url="/orm/overview/databases/sqlite"
image={'/img/technologies/sqlite.svg'}
tech="SQLite"
/>
<SquareLogo
url="/getting-started/setup-prisma/start-from-scratch/mongodb-typescript-mongodb"
image={'/img/technologies/mongodbsimple.svg'}
tech="Mongo DB"
/>
</List>
</TabItem>
<TabItem value="Existing database">
<p>
Get started with Prisma ORM and your <b>existing database</b> by
introspecting your database schema and learn how to query your database.
</p>
<List>
</List>

<br/>
<br/>

{/* ### <Plug color="#16A394" width="24" height="24" /> Using Prisma Postgres with other tools?

You can also use Prisma Postgres with different tools or ORMs. Pick one of the options below to see how to connect.

<List>
<SquareLogo
url="/getting-started/setup-prisma/add-to-existing-project/relational-databases-typescript-postgresql"
image={'/img/technologies/postgresqlsimple.svg'}
tech="Postgres SQL"
url="/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-postgresql"
image={'/img/technologies/kysely.svg'}
tech="Kysely"
/>
<SquareLogo
url="/getting-started/setup-prisma/add-to-existing-project/relational-databases-typescript-mysql"
image={'/img/technologies/mysqlsimple.svg'}
tech="MySQL"
url="/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-mysql"
image={'/img/technologies/drizzle.svg'}
tech="Drizzle"
/>
<SquareLogo
url="/getting-started/setup-prisma/add-to-existing-project/relational-databases-typescript-sqlserver"
image={'/img/technologies/sqlserver.svg'}
tech="SQL Server"
url="/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-sqlserver"
image={'/img/technologies/sequelize.svg'}
tech="Sequelize"
/>
<SquareLogo
url="/getting-started/setup-prisma/add-to-existing-project/relational-databases-typescript-planetscale"
imageDark={'/img/technologies/planetscaledark.svg'}
image={'/img/technologies/planetscale.svg'}
tech="PlanetScale"
url="/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-planetscale"
image={'/img/technologies/typeorm.svg'}
tech="TypeORM"
/>
</List>

<br/>
<br/> */}

### <Plus color="#16A394" width="24" height="24" /> Add Prisma to your favorite framework?

Working with **Next.js**, **Remix**, or another framework? You can easily add Prisma to your setup in just a few steps and start using it right away.

<List>
<SquareLogo
url="/getting-started/setup-prisma/add-to-existing-project/relational-databases-typescript-cockroachdb"
image={'/img/technologies/cockroachdbdark.svg'}
tech="Cockroach DB"
url="/guides/nextjs"
image={'/img/technologies/nextjs.svg'}
tech="Next.js"
/>
<SquareLogo
url="/getting-started/setup-prisma/add-to-existing-project/mongodb-typescript-mongodb"
image={'/img/technologies/mongodbsimple.svg'}
tech="Mongo DB"
url="/guides/astro"
image={'/img/technologies/astro.svg'}
imageDark={'/img/technologies/astrodark.svg'}
tech="Astro.js"
/>
</List>
</TabItem>
</TabbedContent>

## <Bolt color="#16A394" width="21" height="24" /> Prisma Accelerate

Make your database queries faster by scaling your database connections and caching database results at the edge with Prisma Accelerate.

<Grid>
<LinkCard
icon="fa-solid fa-arrow-right"
title="Get started"
desc="Add Accelerate to your app to use global database caching & connection pooling."
link="/accelerate/getting-started"
/>
<LinkCard
icon="fa-brands fa-github"
title="Examples"
desc="Explore our ready-to-run examples using Accelerate."
link="https://github.com/prisma/prisma-examples?tab=readme-ov-file#prisma-accelerate"
/>
</Grid>
<br/>
<LinkCard
highlight
icon="fa-solid fa-bolt"
title="Speed Test"
desc="Run the speed test to see how Prisma Accelerate can make your app faster."
link="https://accelerate-speed-test.prisma.io/"
/>

## <Inspect color="#16A394" width="27" height="24" /> Prisma Optimize

Make your database queries faster by using the insights and recommendations generated by Prisma Optimize.

<Grid>
<LinkCard
icon="fa-solid fa-arrow-right"
title="Get started"
desc="Add Optimize to your app to gather useful insights and receive recommendations to improve query performance."
link="/optimize/getting-started"
/>
<LinkCard
icon="fa-brands fa-github"
title="Examples"
desc="Explore our ready-to-run examples using Prisma Optimize."
link="https://github.com/prisma/prisma-examples?tab=readme-ov-file#prisma-optimize"
/>
</Grid>
<SquareLogo
url="/guides/nuxt"
image={'/img/technologies/nuxtjs.svg'}
tech="Nuxt.js"
/>
<SquareLogo
url="/guides/react-router-7"
image={'/img/technologies/reactrouter.svg'}
tech="React Router 7"
/>
<SquareLogo
url="/guides/tanstack-start"
image={'/img/technologies/tanstack.png'}
tech="TanStack"
/>
<SquareLogo
url="/guides/sveltekit"
image={'/img/technologies/sveltekit.svg'}
tech="SvelteKit"
/>
</List>

31 changes: 30 additions & 1 deletion content/800-guides/010-data-migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,36 @@ model Post {
}
```

### 1.2. Create a development branch
### 1.2. Configure Prisma

Create a `prisma.config.ts` file in the root of your project with the following content:

```typescript file=prisma.config.ts
import 'dotenv/config'
import { defineConfig, env } from 'prisma/config';

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

:::note

You'll need to install the `dotenv` package to load environment variables. If you haven't already, install it using your package manager:

```bash
npm install dotenv
```

:::

### 1.3. Create a development branch

Create a new branch for your changes:

Expand Down
Loading
Loading