Skip to content

Commit

Permalink
fix absolute links
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolasburk committed Nov 29, 2023
1 parent f1934a6 commit 526e362
Show file tree
Hide file tree
Showing 188 changed files with 866 additions and 867 deletions.
5 changes: 2 additions & 3 deletions content/100-getting-started/01-quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you want to use Prisma with your own PostgreSQL, MySQL, MongoDB or any other

## Prerequisites

You need Node.js v16.13.0 or higher for this guide (learn more about [system requirements](/reference/system-requirements)).
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

Expand Down Expand Up @@ -108,7 +108,6 @@ This command did three things:
2. It executed the SQL migration file against the database.
3. It ran `prisma generate` under the hood (which installed the `@prisma/client` package and generated a tailored Prisma Client API based on your models).


Because the SQLite database file didn't exist before, the command also created it inside the `prisma` directory with the name `dev.db` as defined via the environment variable in the `.env` file.

Congratulations, you now have your database and tables ready. Let's go and learn how you can send some queries to read and write data!
Expand Down Expand Up @@ -256,7 +255,7 @@ Notice how the single `User` object is now enclosed with square brackets in the

### 4.3. Explore relation queries with Prisma

One of the main features of Prisma Client is the ease of working with [relations](/concepts/components/prisma-schema/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.
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.

First, adjust your script to include the nested query:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ toc: false

## Connect your database

To connect your database, you need to set the `url` field of the `datasource` block in your Prisma schema to your database [connection URL](/reference/database-reference/connection-urls):
To connect your database, you need to set the `url` field of the `datasource` block in your Prisma schema to your database [connection URL](/orm/reference/connection-urls):

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

Expand All @@ -20,7 +20,7 @@ datasource db {
}
```

In this case, the `url` is [set via an environment variable](/guides/development-environment/environment-variables) which is defined in `.env`:
In this case, the `url` is [set via an environment variable](/orm/more/development-environment/environment-variables) which is defined in `.env`:

```bash file=.env
DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public"
Expand All @@ -34,7 +34,7 @@ We recommend adding `.env` to your `.gitignore` file to prevent committing your

You now need to adjust the connection URL to point to your own database.

The [format of the connection URL](/reference/database-reference/connection-urls) for your database depends on the database you use. For PostgreSQL, it looks as follows (the parts spelled all-uppercased are _placeholders_ for your specific connection details):
The [format of the connection URL](/orm/reference/connection-urls) for your database depends on the database you use. For PostgreSQL, it looks as follows (the parts spelled all-uppercased are _placeholders_ for your specific connection details):

```no-lines
postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=SCHEMA
Expand All @@ -51,7 +51,7 @@ Here's a short explanation of each component:

If you're unsure what to provide for the `schema` parameter for a PostgreSQL connection URL, you can probably omit it. In that case, the default schema name `public` will be used.

As an example, for a PostgreSQL database hosted on Heroku, the [connection URL](/reference/database-reference/connection-urls) might look similar to this:
As an example, for a PostgreSQL database hosted on Heroku, the [connection URL](/orm/reference/connection-urls) might look similar to this:

```bash file=.env
DATABASE_URL="postgresql://opnmyfngbknppm:[email protected]:5432/d50rgmkqi2ipus?schema=hello-prisma"
Expand Down Expand Up @@ -97,7 +97,7 @@ We recommend adding `.env` to your `.gitignore` file to prevent committing your

You now need to adjust the connection URL to point to your own database.

The [format of the connection URL](/reference/database-reference/connection-urls) for your database typically depends on the database you use. For MySQL, it looks as follows (the parts spelled all-uppercased are _placeholders_ for your specific connection details):
The [format of the connection URL](/orm/reference/connection-urls) for your database typically depends on the database you use. For MySQL, it looks as follows (the parts spelled all-uppercased are _placeholders_ for your specific connection details):

```no-lines
mysql://USER:PASSWORD@HOST:PORT/DATABASE
Expand All @@ -110,7 +110,7 @@ Here's a short explanation of each component:
- `PORT`: The port where your database server is running (typically `3306` for MySQL)
- `DATABASE`: The name of the [database](https://dev.mysql.com/doc/refman/8.0/en/creating-database.html)

As an example, for a MySQL database hosted on AWS RDS, the [connection URL](/reference/database-reference/connection-urls) might look similar to this:
As an example, for a MySQL database hosted on AWS RDS, the [connection URL](/orm/reference/connection-urls) might look similar to this:

```bash file=.env
DATABASE_URL="mysql://johndoe:XXX@mysql–instance1.123456789012.us-east-1.rds.amazonaws.com:3306/mydb"
Expand Down Expand Up @@ -160,7 +160,7 @@ DATABASE_URL="mysql://janedoe:[email protected]/mydb?sslacc

You now need to adjust the connection URL to point to your own database.

The [format of the connection URL](/reference/database-reference/connection-urls) for your database typically depends on the database you use. PlanetScale uses the MySQL connection URL format, which has the following structure (the parts spelled all-uppercased are _placeholders_ for your specific connection details):
The [format of the connection URL](/orm/reference/connection-urls) for your database typically depends on the database you use. PlanetScale uses the MySQL connection URL format, which has the following structure (the parts spelled all-uppercased are _placeholders_ for your specific connection details):

```no-lines
mysql://USER:PASSWORD@HOST:PORT/DATABASE
Expand All @@ -173,7 +173,7 @@ Here's a short explanation of each component:
- `PORT`: The port where your database server is running (typically `3306` for MySQL)
- `DATABASE`: The name of the [database](https://dev.mysql.com/doc/refman/8.0/en/creating-database.html)

For a database hosted with PlanetScale, the [connection URL](/reference/database-reference/connection-urls) looks similar to this:
For a database hosted with PlanetScale, the [connection URL](/orm/reference/connection-urls) looks similar to this:

```bash file=.env
DATABASE_URL="mysql://myusername:[email protected]/mydb?sslaccept=strict"
Expand Down Expand Up @@ -218,7 +218,7 @@ datasource db {

In this case, the `url` is [set via an environment variable](/concepts/components/prisma-schema#accessing-environment-variables-from-the-schema) which is defined in `.env`:

The following example connection URL [uses SQL authentication](/concepts/database-connectors/sql-server), but there are [other ways to format your connection URL](/concepts/database-connectors/sql-server)
The following example connection URL [uses SQL authentication](/orm/overview/introduction/databases/sql-server), but there are [other ways to format your connection URL](/orm/overview/introduction/databases/sql-server)

```bash file=.env
DATABASE_URL="sqlserver://localhost:1433;database=mydb;user=sa;password=r@ndomP@$$w0rd;trustServerCertificate=true"
Expand All @@ -230,7 +230,7 @@ We recommend adding `.env` to your `.gitignore` file to prevent committing your

</Admonition>

Adjust the connection URL to match your setup - see [Microsoft SQL Server connection URL](/concepts/database-connectors/sql-server) for more information.
Adjust the connection URL to match your setup - see [Microsoft SQL Server connection URL](/orm/overview/introduction/databases/sql-server) for more information.

> Make sure TCP/IP connections are enabled via [SQL Server Configuration Manager](https://docs.microsoft.com/en-us/sql/relational-databases/sql-server-configuration-manager) to avoid `No connection could be made because the target machine actively refused it. (os error 10061)`
Expand All @@ -254,9 +254,9 @@ datasource db {
}
```

The `url` is [set via an environment variable](/guides/development-environment/environment-variables) which is defined in `.env`. You now need to adjust the connection URL to point to your own database.
The `url` is [set via an environment variable](/orm/more/development-environment/environment-variables) which is defined in `.env`. You now need to adjust the connection URL to point to your own database.

The [format of the connection URL](/reference/database-reference/connection-urls) for your database depends on the database you use. CockroachDB uses the PostgreSQL connection URL format, which has the following structure (the parts spelled all-uppercased are _placeholders_ for your specific connection details):
The [format of the connection URL](/orm/reference/connection-urls) for your database depends on the database you use. CockroachDB uses the PostgreSQL connection URL format, which has the following structure (the parts spelled all-uppercased are _placeholders_ for your specific connection details):

```no-lines
postgresql://USER:PASSWORD@HOST:PORT/DATABASE?PARAMETERS
Expand All @@ -270,15 +270,15 @@ Here's a short explanation of each component:
- `DATABASE`: The name of the database
- `PARAMETERS`: Any additional connection parameters. See the CockroachDB documentation [here](https://www.cockroachlabs.com/docs/stable/connection-parameters.html#additional-connection-parameters).

For a [CockroachDB Serverless](https://www.cockroachlabs.com/docs/cockroachcloud/quickstart.html) or [Cockroach Dedicated](https://www.cockroachlabs.com/docs/cockroachcloud/quickstart-trial-cluster) database hosted on [CockroachDB Cloud](https://www.cockroachlabs.com/get-started-cockroachdb/), the [connection URL](/reference/database-reference/connection-urls) looks similar to this:
For a [CockroachDB Serverless](https://www.cockroachlabs.com/docs/cockroachcloud/quickstart.html) or [Cockroach Dedicated](https://www.cockroachlabs.com/docs/cockroachcloud/quickstart-trial-cluster) database hosted on [CockroachDB Cloud](https://www.cockroachlabs.com/get-started-cockroachdb/), the [connection URL](/orm/reference/connection-urls) looks similar to this:

```bash file=.env
DATABASE_URL="postgresql://<myusername>:<mypassword>@<short-id>.<region>.cockroachlabs.cloud:26257/defaultdb?sslmode=verify-full&sslrootcert=$HOME/.postgresql/root.crt&options=--<mycluster>"
```

To find your connection string on CockroachDB Cloud, click the 'Connect' button on the overview page for your database cluster, and select the 'Connection string' tab.

For a [CockroachDB database hosted locally](https://www.cockroachlabs.com/docs/stable/secure-a-cluster.html), the [connection URL](/reference/database-reference/connection-urls) looks similar to this:
For a [CockroachDB database hosted locally](https://www.cockroachlabs.com/docs/stable/secure-a-cluster.html), the [connection URL](/orm/reference/connection-urls) looks similar to this:

```bash file=.env
DATABASE_URL="postgresql://root@localhost:26257?sslmode=disable"
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](/concepts/components/prisma-migrate) to create the tables in your database. Add the following Prisma data model to your [Prisma schema](/concepts/components/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 Prisma 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](/concepts/components/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 Prisma 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](/concepts/components/prisma-migrate/db-push) 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 Prisma 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](/concepts/components/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 Prisma 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](/concepts/components/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 Prisma 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

## Write your first query with Prisma Client

Now that you have generated [Prisma Client](/concepts/components/prisma-client), you can start writing queries to read and write data in your database. For the purpose of this guide, you'll use a plain Node.js script to explore some basic features of Prisma Client.
Now that you have generated [Prisma Client](/orm/prisma-client), you can start writing queries to read and write data in your database. For the purpose of this guide, you'll use a plain Node.js script to explore some basic features of Prisma Client.

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

Expand Down Expand Up @@ -237,7 +237,7 @@ The output should look similar to this:

<SwitchTech technologies={['typescript']}>

Also note that `allUsers` is _statically typed_ thanks to [Prisma Client's generated types](/concepts/components/prisma-client/advanced-type-safety/operating-against-partial-structures-of-model-types). You can observe the type by hovering over the `allUsers` variable in your editor. It should be typed as follows:
Also note that `allUsers` is _statically typed_ thanks to [Prisma Client's generated types](/orm/prisma-client/type-safety/operating-against-partial-structures-of-model-types). You can observe the type by hovering over the `allUsers` variable in your editor. It should be typed as follows:

```ts no-lines
const allUsers: (User & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ 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](/concepts/overview/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.

### Continue exploring the Prisma Client API

You can send a variety of queries with the Prisma Client API. Check out the [API reference](/concepts/components/prisma-client) and use your existing database setup from this guide to try them out.
You can send a variety of queries with the Prisma Client API. Check out the [API reference](/orm/prisma-client) and use your existing database setup from this guide to try them out.

<Tip>

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](/concepts/components/prisma-cli), [Prisma Client](/concepts/components/prisma-client), and [Prisma Migrate](/concepts/components/prisma-migrate).
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).

</TopBlock>

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

- [Node.js](https://nodejs.org/en/) installed on your machine
- A [Microsoft SQL Server](https://docs.microsoft.com/en-us/sql/?view=sql-server-ver15) database
- [Microsoft SQL Server on Linux for Docker](/concepts/database-connectors/sql-server/sql-server-docker)
- [Microsoft SQL Server on Windows (local)](/concepts/database-connectors/sql-server/sql-server-local)
- [Microsoft SQL Server on Linux for Docker](/orm/overview/introduction/databases/sql-server/sql-server-docker)
- [Microsoft SQL Server on Windows (local)](/orm/overview/introduction/databases/sql-server/sql-server-local)

</SwitchTech>

> See [System requirements](/reference/system-requirements) for exact version requirements.
> See [System requirements](/orm/reference/system-requirements) for exact version requirements.
Make sure you have your database [connection URL](/reference/database-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, 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](/concepts/components/prisma-schema) file with the following command:
Next, set up your Prisma 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 526e362

Please sign in to comment.