From cac2155f64ce73644ec6747c3190de3a1234fc27 Mon Sep 17 00:00:00 2001 From: ruheni Date: Wed, 10 May 2023 15:57:05 +0200 Subject: [PATCH 1/5] chore: clarify role of schema & workflow --- .../110-relational-databases/200-install-prisma-client.mdx | 2 +- .../120-mongodb/200-install-prisma-client.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/200-install-prisma-client.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/200-install-prisma-client.mdx index c2cdfaddef..17288239b1 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/200-install-prisma-client.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/200-install-prisma-client.mdx @@ -19,7 +19,7 @@ Notice that the install command automatically invokes `prisma generate` for you ![Install and generate Prisma Client](../../../images/prisma-client-install-and-generate.png) -Whenever you make changes to your Prisma schema in the future, you manually need to invoke `prisma generate` in order to accommodate the changes in your Prisma Client API. +Whenever you update your Prisma schema, you will have to update your database schema using either `prisma migrate dev` or `prisma db push`. This will keep your database schema in sync with your Prisma schema. The commands will also regenerate Prisma Client to update your Prisma Client API. diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/200-install-prisma-client.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/200-install-prisma-client.mdx index 1ef3355355..f8eccfd9d9 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/200-install-prisma-client.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/200-install-prisma-client.mdx @@ -19,7 +19,7 @@ Notice that the install command automatically invokes `prisma generate` for you ![Install and generate Prisma Client](./../../../images/prisma-client-install-and-generate.png) -Whenever you make changes to your Prisma schema in the future, you manually need to invoke `prisma generate` in order to accommodate the changes in your Prisma Client API. +Whenever you update your Prisma schema, you will need to regenerate Prisma Client using the `prisma generate` command to update your Prisma Client API. From 34b1c09159920e23a17976128710722408a672c7 Mon Sep 17 00:00:00 2001 From: ruheni Date: Fri, 12 May 2023 12:16:56 +0200 Subject: [PATCH 2/5] chore: clarify getting started with existing db instructions --- .../250-querying-the-database.mdx | 8 +++++++- .../120-mongodb/250-querying-the-database.mdx | 6 +----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database.mdx index 2d60cd0647..49438b0473 100644 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database.mdx +++ b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database.mdx @@ -123,7 +123,13 @@ node index.js -This will print an array of `User` records as plain old JavaScript objects. +If you created a database using the schema from the database introspection step, the query should print an empty array because there are no `User` records in the database yet. + +```no-copy +[] +``` + +If you introspected an existing database with records, the query should return an array of JavaScript objects. ## Write data into the database diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database.mdx index 2392bed36d..8021c481a5 100644 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database.mdx +++ b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database.mdx @@ -128,11 +128,7 @@ node index.js -This should print an empty array because there are no `User` records in the database yet: - -```json no-lines -[] -``` +If you introspected an existing database with records, the query should return an array of JavaScript objects. ## Write data into the database From a16fe6c6360127cffdfd2f1e3fa8af9d6df39235 Mon Sep 17 00:00:00 2001 From: ruheni Date: Fri, 12 May 2023 12:24:02 +0200 Subject: [PATCH 3/5] chore: add connection url heading --- .../100-connect-your-database.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/100-connect-your-database.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/100-connect-your-database.mdx index 0569d88844..747446d9b3 100644 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/100-connect-your-database.mdx +++ b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/100-connect-your-database.mdx @@ -28,6 +28,8 @@ DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=pub You now need to adjust the connection URL to point to your own database. +### Connection URL + 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): ```no-lines @@ -78,6 +80,8 @@ DATABASE_URL="mysql://johndoe:randompassword@localhost:3306/mydb" You now need to adjust the connection URL to point to your own database. +### Connection URL + 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): ```no-lines @@ -141,6 +145,8 @@ DATABASE_URL="mysql://janedoe:mypassword@server.us-east-2.psdb.cloud/mydb?sslacc You now need to adjust the connection URL to point to your own database. +### Connection URL + 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): ```no-lines @@ -223,6 +229,8 @@ 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. +### Connection URL + 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): ```no-lines From ae46cca37f9023ad2fb02a39cb25ae0d16a1aa72 Mon Sep 17 00:00:00 2001 From: ruheni Date: Fri, 12 May 2023 15:25:54 +0200 Subject: [PATCH 4/5] chore: fix connection URL heading --- .../100-connect-your-database.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/100-connect-your-database.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/100-connect-your-database.mdx index 747446d9b3..e00ab0a713 100644 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/100-connect-your-database.mdx +++ b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/100-connect-your-database.mdx @@ -28,7 +28,7 @@ DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=pub You now need to adjust the connection URL to point to your own database. -### Connection URL +

Connection URL

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): @@ -80,7 +80,7 @@ DATABASE_URL="mysql://johndoe:randompassword@localhost:3306/mydb" You now need to adjust the connection URL to point to your own database. -### Connection URL +

Connection URL

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): @@ -145,7 +145,7 @@ DATABASE_URL="mysql://janedoe:mypassword@server.us-east-2.psdb.cloud/mydb?sslacc You now need to adjust the connection URL to point to your own database. -### Connection URL +

Connection URL

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): @@ -229,7 +229,7 @@ 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. -### Connection URL +

Connection URL

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): From 2b2b45d79742d06ed96cec710444daf4cbb145f1 Mon Sep 17 00:00:00 2001 From: ruheni Date: Mon, 15 May 2023 16:45:56 +0200 Subject: [PATCH 5/5] chore: update wording --- .../110-relational-databases/200-install-prisma-client.mdx | 2 +- .../120-mongodb/200-install-prisma-client.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/200-install-prisma-client.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/200-install-prisma-client.mdx index 17288239b1..f8a47a3821 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/200-install-prisma-client.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/200-install-prisma-client.mdx @@ -19,7 +19,7 @@ Notice that the install command automatically invokes `prisma generate` for you ![Install and generate Prisma Client](../../../images/prisma-client-install-and-generate.png) -Whenever you update your Prisma schema, you will have to update your database schema using either `prisma migrate dev` or `prisma db push`. This will keep your database schema in sync with your Prisma schema. The commands will also regenerate Prisma Client to update your Prisma Client API. +Whenever you update your Prisma schema, you will have to update your database schema using either `prisma migrate dev` or `prisma db push`. This will keep your database schema in sync with your Prisma schema. The commands will also regenerate Prisma Client. diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/200-install-prisma-client.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/200-install-prisma-client.mdx index f8eccfd9d9..4d028f403a 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/200-install-prisma-client.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/200-install-prisma-client.mdx @@ -19,7 +19,7 @@ Notice that the install command automatically invokes `prisma generate` for you ![Install and generate Prisma Client](./../../../images/prisma-client-install-and-generate.png) -Whenever you update your Prisma schema, you will need to regenerate Prisma Client using the `prisma generate` command to update your Prisma Client API. +Whenever you update your Prisma schema, you will need to run the `prisma db push` command to create new indexes and regenerate Prisma Client.