-
Notifications
You must be signed in to change notification settings - Fork 788
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1934a6
commit 526e362
Showing
188 changed files
with
866 additions
and
867 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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']}> | ||
|
||
|
@@ -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" | ||
|
@@ -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 | ||
|
@@ -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" | ||
|
@@ -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 | ||
|
@@ -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" | ||
|
@@ -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 | ||
|
@@ -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" | ||
|
@@ -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" | ||
|
@@ -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)` | ||
|
@@ -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 | ||
|
@@ -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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.