Skip to content

Commit

Permalink
Merge branch 'main' into petradonka-patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
jharrell committed Mar 27, 2024
2 parents 206451f + 28e58a7 commit 4e7553f
Show file tree
Hide file tree
Showing 385 changed files with 6,956 additions and 5,415 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
content/* @prisma/dev-advocates-write
4 changes: 2 additions & 2 deletions .github/workflows/lost-pixel.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: LostPixel

on: [push]
Expand All @@ -17,8 +18,7 @@ jobs:
id: gatsby-cache-build
uses: actions/cache@v2
with:
path: |
public
path: public
.cache
key: ${{ runner.os }}-gatsby-build-${{ github.run_id }}
restore-keys: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/notion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:
inputs:
setup:
description: 'Populate your notion database with all the requried properties'
description: 'Populate your notion database with all the required properties'
type: boolean
syncIssues:
description: 'sync all other existing issues in this repo'
Expand Down
6 changes: 4 additions & 2 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
"Rallly",
"Dundring",
"Letterpad",
"Hitori"
"Hitori",
"Zenstack"
],
"ignoreWords": [
"Ania",
Expand All @@ -92,7 +93,8 @@
"Distroless",
"Nikolas",
"Supavisor",
"inshellisense"
"inshellisense",
"janedoe"
],
"patterns": [
{
Expand Down
57 changes: 34 additions & 23 deletions config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,22 @@ const siteConfig = {
type: 'bucket',
bucketName: '/300-accelerate',
hidden: false,
includeSideNav: '/500-platform',
},
{
text: 'Pulse',
to: '/pulse',
type: 'bucket',
bucketName: '/400-pulse',
hidden: false,
includeSideNav: '/500-platform',
},
{
text: 'Platform',
to: '/platform',
type: 'bucket',
bucketName: '/500-platform',
hidden: false,
hidden: true,
},
{
text: 'About',
Expand Down Expand Up @@ -89,7 +91,7 @@ const siteConfig = {
},
ORMPlatformLinkData: {
porm: {
title: 'Prisma ORM',
title: 'Build with Prisma ORM',
icon: 'database',
description:
'Open source Node.js and TypeScript ORM with an intuitive data model, automated migrations, type-safety, and auto-completion.',
Expand All @@ -106,10 +108,10 @@ const siteConfig = {
],
},
pdp: {
title: 'Prisma Data Platform',
title: 'Grow as your app evolves',
icon: 'triangle',
description:
'An ecosystem of tools empowering teams to build data-heavy, global-first applications.',
'Expand your application capabilities with global database caching, connection pooling and real-time database events.',
links: [
{
url: 'accelerate',
Expand All @@ -124,7 +126,7 @@ const siteConfig = {
},
GeneralLinkData: [
{
title: `What is Prisma`,
title: `What is Prisma ORM`,
description: 'An overview of what Prisma ORM is and how it works.',
url: 'orm/overview/introduction/what-is-prisma',
icon: 'fa-regular fa-question',
Expand All @@ -136,9 +138,9 @@ const siteConfig = {
icon: 'fa-solid fa-arrow-right-arrow-left',
},
{
title: `Prisma in your stack`,
title: `Prisma ORM in your stack`,
description:
'Use Prisma to build a GraphQL or REST API, or as part of a fullstack application.',
'Use Prisma ORM to build a GraphQL or REST API, or as part of a fullstack application.',
url: 'orm/overview/prisma-in-your-stack',
icon: 'fa-solid fa-server',
},
Expand All @@ -149,8 +151,8 @@ const siteConfig = {
icon: 'fa-solid fa-eye',
},
{
title: `Adopting Prisma`,
description: 'Migrate to Prisma from other ORMs.',
title: `Adopting Prisma ORM`,
description: 'Migrate to Prisma ORM from other ORMs.',
url: 'orm/more/migrating-to-prisma',
icon: 'fa-solid fa-download',
},
Expand All @@ -163,31 +165,39 @@ const siteConfig = {
},
],
CommunityLinksData: [
// {
// id: 'slack',
// title: 'Slack',
// description: 'Engage with a vibrant community of developers and companies adopting Prisma',
// icon: 'fa-brands fa-slack',
// link: 'https://slack.prisma.io/',
// linkText: 'Join our channel',
// },
{
id: 'slack',
title: 'Slack',
description: 'Engage with a vibrant community of developers and companies adopting Prisma',
icon: 'fa-brands fa-slack',
link: 'https://slack.prisma.io/',
linkText: 'Join our channel',
id: 'discord',
title: 'Discord',
description:
'Chat in real-time, hang out, and share ideas with community members and our team.',
icon: 'fa-brands fa-discord',
link: 'https://pris.ly/discord',
linkText: 'Join our server',
},
{
id: 'github',
title: 'GitHub',
description:
'Browse the Prisma source code, send feedback, or join the discussion on GitHub.',
'Browse the Prisma ORM source code, send feedback, or join the discussion on GitHub.',
icon: 'fa-brands fa-github',
link: 'https://github.com/prisma',
linkText: 'Contribute in GitHub',
},
{
id: 'discord',
title: 'Discord',
description:
'Chat in real-time, hang out, and share ideas with community members and our team.',
icon: 'fa-brands fa-discord',
link: 'https://pris.ly/discord',
linkText: 'Join our server',
id: 'X',
title: 'X',
description: 'Stay up-to-date, join the discussion, and connect with the community on X.',
icon: 'fa-brands fa-x-twitter',
link: 'https://twitter.com/prisma',
linkText: 'Follow us on X',
},
],
CardLinks: {
Expand Down Expand Up @@ -264,6 +274,7 @@ const siteConfig = {
footer: {
newsletter: {
text: 'Stay up to date with the latest features and changes to Prisma',
GATSBY_BREVO_API_KEY: process.env.GATSBY_BREVO_API_KEY || '',
},
},
}
Expand Down
38 changes: 19 additions & 19 deletions content/100-getting-started/01-quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
title: 'Quickstart'
duration: '5 min'
metaTitle: 'Quickstart with TypeScript & SQLite'
metaDescription: 'Get started with Prisma in 5 minutes. You will learn how to send queries to a SQLite database in a plain TypeScript script using Prisma Client.'
metaDescription: 'Get started with Prisma ORM in 5 minutes. You will learn how to send queries to a SQLite database in a plain TypeScript script using Prisma Client.'
search: true
---

<TopBlock>

In this Quickstart guide, you'll learn how to get started with Prisma from scratch using a plain **TypeScript** project and a local **SQLite** database file. It covers **data modeling**, **migrations** and **querying** a database.
In this Quickstart guide, you'll learn how to get started with Prisma ORM from scratch using a plain **TypeScript** project and a local **SQLite** database file. It covers **data modeling**, **migrations** and **querying** a database.

If you want to use Prisma with your own PostgreSQL, MySQL, MongoDB or any other supported database, go here instead:
If you want to use Prisma ORM with your own PostgreSQL, MySQL, MongoDB or any other supported database, go here instead:

- [Start with Prisma from scratch](/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-postgresql)
- [Add Prisma to an existing project](/getting-started/setup-prisma/add-to-existing-project/relational-databases-typescript-postgresql)
- [Start with Prisma ORM from scratch](/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-postgresql)
- [Add Prisma ORM to an existing project](/getting-started/setup-prisma/add-to-existing-project/relational-databases-typescript-postgresql)

</TopBlock>

## Prerequisites

You need Node.js v16.13.0 or higher for this guide (learn more about [system requirements](/orm/reference/system-requirements)).

## 1. Create TypeScript project and set up Prisma
## 1. Create TypeScript project and set up Prisma ORM

As a first step, create a project directory and navigate into it:

Expand Down Expand Up @@ -57,7 +57,7 @@ Then, install the Prisma CLI as a development dependency in the project:
npm install prisma --save-dev
```

Finally, set up Prisma with the `init` command of the Prisma CLI:
Finally, set up Prisma ORM with the `init` command of the Prisma CLI:

```terminal
npx prisma init --datasource-provider sqlite
Expand Down Expand Up @@ -253,7 +253,7 @@ npx ts-node script.ts

Notice how the single `User` object is now enclosed with square brackets in the console. That's because the `findMany` returned an array with a single object inside.

### 4.3. Explore relation queries with Prisma
### 4.3. Explore relation queries with Prisma Client

One of the main features of Prisma Client is the ease of working with [relations](/orm/prisma-schema/data-model/relations). In this section, you'll learn how to create a `User` and a `Post` record in a nested write query. Afterwards, you'll see how you can retrieve the relation from the database using the `include` option.

Expand Down Expand Up @@ -312,7 +312,7 @@ npx ts-node script.ts

</CodeWithResult>

By default, Prisma only returns _scalar_ fields in the result objects of a query. That's why, even though you also created a new `Post` record for the new `User` record, the console only printed an object with three scalar fields: `id`, `email` and `name`.
By default, Prisma Client only returns _scalar_ fields in the result objects of a query. That's why, even though you also created a new `Post` record for the new `User` record, the console only printed an object with three scalar fields: `id`, `email` and `name`.

In order to also retrieve the `Post` records that belong to a `User`, you can use the `include` option via the `posts` relation field:

Expand Down Expand Up @@ -385,30 +385,30 @@ Notice that the objects in the `usersWithPosts` array are fully typed as well. T

## 5. Next steps

In this Quickstart guide, you have learned how to get started with Prisma in a plain TypeScript project. Feel free to explore the Prisma Client API a bit more on your own, e.g. by including filtering, sorting, and pagination options in the `findMany` query or exploring more operations like `update` and `delete` queries.
In this Quickstart guide, you have learned how to get started with Prisma ORM in a plain TypeScript project. Feel free to explore the Prisma Client API a bit more on your own, e.g. by including filtering, sorting, and pagination options in the `findMany` query or exploring more operations like `update` and `delete` queries.

### Explore the data in Prisma Studio

Prisma comes with a built-in GUI to view and edit the data in your database. You can open it using the following command:
Prisma ORM comes with a built-in GUI to view and edit the data in your database. You can open it using the following command:

```terminal
npx prisma studio
```

### Set up Prisma with your own database
### Set up Prisma ORM with your own database

If you want to move forward with Prisma using your own PostgreSQL, MySQL, MongoDB or any other supported database, follow the Set Up Prisma guides:
If you want to move forward with Prisma ORM using your own PostgreSQL, MySQL, MongoDB or any other supported database, follow the Set Up Prisma ORM guides:

- [Start with Prisma from scratch](/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-postgresql)
- [Add Prisma to an existing project](/getting-started/setup-prisma/add-to-existing-project)
- [Start with Prisma ORM from scratch](/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-postgresql)
- [Add Prisma ORM to an existing project](/getting-started/setup-prisma/add-to-existing-project)

### Explore ready-to-run Prisma examples
### Explore ready-to-run Prisma ORM examples

Check out the [`prisma-examples`](https://github.com/prisma/prisma-examples/) repository on GitHub to see how Prisma can be used with your favorite library. The repo contains examples with Express, NestJS, GraphQL as well as fullstack examples with Next.js and Vue.js, and a lot more.
Check out the [`prisma-examples`](https://github.com/prisma/prisma-examples/) repository on GitHub to see how Prisma ORM can be used with your favorite library. The repo contains examples with Express, NestJS, GraphQL as well as fullstack examples with Next.js and Vue.js, and a lot more.

### Build an app with Prisma
### Build an app with Prisma ORM

The Prisma blog features comprehensive tutorials about Prisma, check out our latest ones:
The Prisma blog features comprehensive tutorials about Prisma ORM, check out our latest ones:

- [Build a fullstack app with Remix](https://www.prisma.io/blog/fullstack-remix-prisma-mongodb-1-7D0BfTXBmB6r) (5 parts, including videos)
- [Build a REST API with NestJS](https://www.prisma.io/blog/nestjs-prisma-rest-api-7D056s1BmOL0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ datasource db {
}
```

You will also need to [set the relation mode type to `prisma`](/orm/prisma-schema/data-model/relations/relation-mode#emulate-relations-in-prisma-with-the-prisma-relation-mode) in the `datasource` block:
You will also need to set the relation mode type to `prisma` in order to [emulate foreign key constraints](/orm/overview/databases/planetscale#option-1-emulate-relations-in-prisma-client) in the `datasource` block:

```prisma file=schema.prisma highlight=4;add
datasource db {
Expand All @@ -152,6 +152,8 @@ datasource db {
}
```

> **Note**: Since February 2024, you can alternatively [use foreign key constraints on a database-level in PlanetScale](/orm/overview/databases/planetscale#option-2-enable-foreign-key-constraints-in-the-planetscale-database-settings), which omits the need for setting `relationMode = "prisma"`.
The `url` is [set via an environment variable](/orm/prisma-schema/overview#accessing-environment-variables-from-the-schema) which is defined in `.env`:

```bash file=.env
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ toc: false

<SwitchTech technologies={['*', 'postgresql']}>

In this guide, you'll use [Prisma Migrate](/orm/prisma-migrate) to create the tables in your database. Add the following Prisma data model to your [Prisma schema](/orm/prisma-schema) in `prisma/schema.prisma`:
In this guide, you'll use [Prisma Migrate](/orm/prisma-migrate) to create the tables in your database. Add the following data model to your [Prisma schema](/orm/prisma-schema) in `prisma/schema.prisma`:

```prisma file=prisma/schema.prisma copy
model Post {
Expand Down Expand Up @@ -60,7 +60,7 @@ Great, you now created three tables in your database with Prisma Migrate 🚀

<SwitchTech technologies={['*', 'mysql']}>

In this guide, you'll use [Prisma Migrate](/orm/prisma-migrate) to create the tables in your database. Add the following Prisma data model to your Prisma schema in `prisma/schema.prisma`:
In this guide, you'll use [Prisma Migrate](/orm/prisma-migrate) to create the tables in your database. Add the following data model to your Prisma schema in `prisma/schema.prisma`:

```prisma file=prisma/schema.prisma copy
model Post {
Expand Down Expand Up @@ -109,7 +109,7 @@ Great, you now created three tables in your database with Prisma Migrate 🚀

<SwitchTech technologies={['*', 'planetscale']}>

In this guide, you'll use Prisma's [`db push` command](/orm/prisma-migrate/workflows/prototyping-your-schema) to create the tables in your database. Add the following Prisma data model to your Prisma schema in `prisma/schema.prisma`:
In this guide, you'll use Prisma's [`db push` command](/orm/prisma-migrate/workflows/prototyping-your-schema) to create the tables in your database. Add the following data model to your Prisma schema in `prisma/schema.prisma`:

```prisma file=prisma/schema.prisma copy
model Post {
Expand Down Expand Up @@ -157,7 +157,7 @@ Great, you now created three tables in your database with Prisma's `db push` com

<SwitchTech technologies={['*', 'sqlserver']}>

In this guide, you'll use [Prisma Migrate](/orm/prisma-migrate) to create the tables in your database. Add the following Prisma data model to your Prisma schema in `prisma/schema.prisma`:
In this guide, you'll use [Prisma Migrate](/orm/prisma-migrate) to create the tables in your database. Add the following data model to your Prisma schema in `prisma/schema.prisma`:

```prisma file=prisma/schema.prisma copy
model Post {
Expand Down Expand Up @@ -533,7 +533,7 @@ END CATCH

<SwitchTech technologies={['*', 'cockroachdb']}>

In this guide, you'll use [Prisma Migrate](/orm/prisma-migrate) to create the tables in your database. Add the following Prisma data model to your Prisma schema in `prisma/schema.prisma`:
In this guide, you'll use [Prisma Migrate](/orm/prisma-migrate) to create the tables in your database. Add the following data model to your Prisma schema in `prisma/schema.prisma`:

```prisma file=prisma/schema.prisma copy
model Post {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ toc: false

## Next steps

This section lists a number of potential next steps you can now take from here. Feel free to explore these or read the [Introduction](/orm/overview/introduction/what-is-prisma) page to get a high-level overview of Prisma.
This section lists a number of potential next steps you can now take from here. Feel free to explore these or read the [Introduction](/orm/overview/introduction/what-is-prisma) page to get a high-level overview of Prisma ORM.

### Continue exploring the Prisma Client API

Expand Down Expand Up @@ -73,7 +73,7 @@ const deletedUser = await prisma.user.delete({

Prisma Studio is a visual editor for the data in your database. Run `npx prisma studio` in your terminal.

### Try a Prisma example
### Try a Prisma ORM example

The [`prisma-examples`](https://github.com/prisma/prisma-examples/) repository contains a number of ready-to-run examples:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dbSwitcher: ['postgresql', 'mysql', 'sqlserver', 'planetscale', 'cockroachdb']

<TopBlock>

Learn how to create a new Node.js or TypeScript project from scratch by connecting Prisma to your database and generating a Prisma Client for database access. The following tutorial introduces you to the [Prisma CLI](/orm/tools/prisma-cli), [Prisma Client](/orm/prisma-client), and [Prisma Migrate](/orm/prisma-migrate).
Learn how to create a new Node.js or TypeScript project from scratch by connecting Prisma ORM to your database and generating a Prisma Client for database access. The following tutorial introduces you to the [Prisma CLI](/orm/tools/prisma-cli), [Prisma Client](/orm/prisma-client), and [Prisma Migrate](/orm/prisma-migrate).

</TopBlock>

Expand Down Expand Up @@ -63,7 +63,7 @@ This tutorial will also assume that you can push to the `main` branch of your da

> See [System requirements](/orm/reference/system-requirements) for exact version requirements.
Make sure you have your database [connection URL](/orm/reference/connection-urls) at hand. If you don't have a database server running and just want to explore Prisma, check out the [Quickstart](/getting-started/quickstart).
Make sure you have your database [connection URL](/orm/reference/connection-urls) at hand. If you don't have a database server running and just want to explore Prisma ORM, check out the [Quickstart](/getting-started/quickstart).

## Create project setup

Expand Down Expand Up @@ -118,7 +118,7 @@ You can now invoke the Prisma CLI by prefixing it with `npx`:
npx prisma
```

Next, set up your Prisma project by creating your [Prisma schema](/orm/prisma-schema) file with the following command:
Next, set up your Prisma ORM project by creating your [Prisma schema](/orm/prisma-schema) file with the following command:

```terminal copy
npx prisma init
Expand Down
Loading

0 comments on commit 4e7553f

Please sign in to comment.