-
Notifications
You must be signed in to change notification settings - Fork 785
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docusaurus: Feat/da 139 finish tech switcher (#5762)
* add more techswitcher pages * add mongodb switcher * fix: Continuing ui fixes (#5757) * update box for subsections update search page colors * update carets * update spacing between icons * update in this section * update hide toc * fix kappa icon * update font size * Docusaurus: more random things (#5759) * Add back prism.css file. Resolves DA-147 * fix some broken tables * make baseUrl /docs * remove docusaurus template stuff. Resolves DA-148 * update sidenavs + use _category_.json + move custom props to frontMatter. Resolves DA-151 * add techswithcer pages * update index for relational databases * update start-from-scratch/mongodb * finish all techswitchers * fix image path for tech switcher * update space taker for no toc --------- Co-authored-by: Jon Harrell <[email protected]>
- Loading branch information
Showing
151 changed files
with
16,508 additions
and
6,708 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
...tup-prisma/100-start-from-scratch/110-relational-databases-node-cockroachdb.mdx
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
title: 'Relational databases' | ||
metaTitle: 'Start from scratch with relational databases (15 min)' | ||
metaDescription: 'Learn how to create a new Node.js or TypeScript project from scratch by connecting Prisma to your relational database and generating a Prisma Client for database access.' | ||
hide_table_of_contents: true | ||
langSwitcher: ['typescript', 'node'] | ||
dbSwitcher: ['postgresql', 'mysql', 'sqlserver', 'planetscale', 'cockroachdb'] | ||
sidebar_custom_props: { badge: '15 min' } | ||
sidebar_class_name: hidden-sidebar | ||
--- | ||
|
||
<TopBlock | ||
title={frontMatter.title} | ||
langSwitcher={['typescript', 'node']} | ||
dbSwitcher={['postgresql', 'mysql', 'sqlserver', 'planetscale', 'cockroachdb']} | ||
slug={"/getting-started/setup-prisma/start-from-scratch/relational-databases-"} | ||
> | ||
|
||
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> | ||
|
||
## Prerequisites | ||
|
||
In order to successfully complete this guide, you need: | ||
|
||
- [Node.js](https://nodejs.org/en/) installed on your machine | ||
- a [CockroachDB](https://www.cockroachlabs.com/) database server running | ||
|
||
> 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 ORM, check out the [Quickstart](/getting-started/quickstart). | ||
|
||
## Create project setup | ||
|
||
As a first step, create a project directory and navigate into it: | ||
|
||
```terminal copy | ||
mkdir hello-prisma | ||
cd hello-prisma | ||
``` | ||
|
||
Next, initialize a Node.js project and add the Prisma CLI as a development dependency to it: | ||
|
||
```terminal copy | ||
npm init -y | ||
npm install prisma --save-dev | ||
``` | ||
|
||
This creates a `package.json` with an initial setup for a Node.js app. | ||
|
||
<NavigationLinksContainer isFirstLink> | ||
|
||
<ButtonLink | ||
color="dark" | ||
type="primary" | ||
href="./relational-databases/connect-your-database-node-cockroachdb" | ||
arrow | ||
> | ||
Connect your database | ||
</ButtonLink> | ||
|
||
</NavigationLinksContainer> |
87 changes: 87 additions & 0 deletions
87
.../02-setup-prisma/100-start-from-scratch/110-relational-databases-node-mysql.mdx
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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--- | ||
title: 'Relational databases' | ||
metaTitle: 'Start from scratch with relational databases (15 min)' | ||
metaDescription: 'Learn how to create a new Node.js or TypeScript project from scratch by connecting Prisma to your relational database and generating a Prisma Client for database access.' | ||
hide_table_of_contents: true | ||
langSwitcher: ['typescript', 'node'] | ||
dbSwitcher: ['postgresql', 'mysql', 'sqlserver', 'planetscale', 'cockroachdb'] | ||
sidebar_custom_props: { badge: '15 min' } | ||
sidebar_class_name: hidden-sidebar | ||
--- | ||
|
||
<TopBlock | ||
title={frontMatter.title} | ||
langSwitcher={['typescript', 'node']} | ||
dbSwitcher={['postgresql', 'mysql', 'sqlserver', 'planetscale', 'cockroachdb']} | ||
slug={"/getting-started/setup-prisma/start-from-scratch/relational-databases-"} | ||
> | ||
|
||
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> | ||
|
||
## Prerequisites | ||
|
||
In order to successfully complete this guide, you need: | ||
|
||
- [Node.js](https://nodejs.org/en/) installed on your machine | ||
- a [MySQL](https://www.mysql.com/) database server running | ||
|
||
> 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 ORM, check out the [Quickstart](/getting-started/quickstart). | ||
|
||
## Create project setup | ||
|
||
As a first step, create a project directory and navigate into it: | ||
|
||
```terminal copy | ||
mkdir hello-prisma | ||
cd hello-prisma | ||
``` | ||
|
||
Next, initialize a Node.js project and add the Prisma CLI as a development dependency to it: | ||
|
||
```terminal copy | ||
npm init -y | ||
npm install prisma --save-dev | ||
``` | ||
|
||
This creates a `package.json` with an initial setup for a Node.js app. | ||
|
||
<Admonition> | ||
|
||
See [installation instructions](/orm/tools/prisma-cli#installation) to learn how to install Prisma using a different package manager. | ||
|
||
</Admonition> | ||
|
||
You can now invoke the Prisma CLI by prefixing it with `npx`: | ||
|
||
```terminal | ||
npx prisma | ||
``` | ||
|
||
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 | ||
``` | ||
|
||
This command does two things: | ||
|
||
- creates a new directory called `prisma` that contains a file called `schema.prisma`, which contains the Prisma schema with your database connection variable and schema models | ||
- creates the [`.env` file](/orm/more/development-environment/environment-variables/env-files) in the root directory of the project, which is used for defining environment variables (such as your database connection) | ||
|
||
|
||
<NavigationLinksContainer isFirstLink> | ||
|
||
<ButtonLink | ||
color="dark" | ||
type="primary" | ||
href="./relational-databases/connect-your-database-node-mysql" | ||
arrow | ||
> | ||
Connect your database | ||
</ButtonLink> | ||
|
||
</NavigationLinksContainer> |
79 changes: 79 additions & 0 deletions
79
...tup-prisma/100-start-from-scratch/110-relational-databases-node-planetscale.mdx
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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
title: 'Relational databases' | ||
metaTitle: 'Start from scratch with relational databases (15 min)' | ||
metaDescription: 'Learn how to create a new Node.js or TypeScript project from scratch by connecting Prisma to your relational database and generating a Prisma Client for database access.' | ||
hide_table_of_contents: true | ||
langSwitcher: ['typescript', 'node'] | ||
dbSwitcher: ['postgresql', 'mysql', 'sqlserver', 'planetscale', 'cockroachdb'] | ||
sidebar_custom_props: { badge: '15 min' } | ||
sidebar_class_name: hidden-sidebar | ||
--- | ||
|
||
<TopBlock | ||
title={frontMatter.title} | ||
langSwitcher={['typescript', 'node']} | ||
dbSwitcher={['postgresql', 'mysql', 'sqlserver', 'planetscale', 'cockroachdb']} | ||
slug={"/getting-started/setup-prisma/start-from-scratch/relational-databases-"} | ||
> | ||
|
||
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> | ||
|
||
## Prerequisites | ||
|
||
In order to successfully complete this guide, you need: | ||
|
||
- [Node.js](https://nodejs.org/en/) installed on your machine | ||
- a [PlanetScale](https://www.planetscale.com/) database server running | ||
|
||
<Admonition type="warning"> | ||
|
||
This tutorial will also assume that you can push to the `main` branch of your database. Do not do this if your `main` branch has been promoted to production. | ||
|
||
</Admonition> | ||
|
||
Next, initialize a Node.js project and add the Prisma CLI as a development dependency to it: | ||
|
||
```terminal copy | ||
npm init -y | ||
npm install prisma --save-dev | ||
``` | ||
|
||
This creates a `package.json` with an initial setup for a Node.js app. | ||
|
||
<Admonition> | ||
|
||
See [installation instructions](/orm/tools/prisma-cli#installation) to learn how to install Prisma using a different package manager. | ||
|
||
</Admonition> | ||
|
||
You can now invoke the Prisma CLI by prefixing it with `npx`: | ||
|
||
```terminal | ||
npx prisma | ||
``` | ||
|
||
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 | ||
``` | ||
|
||
This command does two things: | ||
|
||
- creates a new directory called `prisma` that contains a file called `schema.prisma`, which contains the Prisma schema with your database connection variable and schema models | ||
- creates the [`.env` file](/orm/more/development-environment/environment-variables/env-files) in the root directory of the project, which is used for defining environment variables (such as your database connection) | ||
|
||
<NavigationLinksContainer isFirstLink> | ||
|
||
<ButtonLink | ||
color="dark" | ||
type="primary" | ||
href="./relational-databases/connect-your-database-node-planetscale" | ||
arrow | ||
> | ||
Connect your database | ||
</ButtonLink> | ||
|
||
</NavigationLinksContainer> |
86 changes: 86 additions & 0 deletions
86
...etup-prisma/100-start-from-scratch/110-relational-databases-node-postgresql.mdx
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
title: 'Relational databases' | ||
metaTitle: 'Start from scratch with relational databases (15 min)' | ||
metaDescription: 'Learn how to create a new Node.js or TypeScript project from scratch by connecting Prisma to your relational database and generating a Prisma Client for database access.' | ||
hide_table_of_contents: true | ||
langSwitcher: ['typescript', 'node'] | ||
dbSwitcher: ['postgresql', 'mysql', 'sqlserver', 'planetscale', 'cockroachdb'] | ||
sidebar_custom_props: { badge: '15 min' } | ||
sidebar_class_name: hidden-sidebar | ||
--- | ||
|
||
<TopBlock | ||
title={frontMatter.title} | ||
langSwitcher={['typescript', 'node']} | ||
dbSwitcher={['postgresql', 'mysql', 'sqlserver', 'planetscale', 'cockroachdb']} | ||
slug={"/getting-started/setup-prisma/start-from-scratch/relational-databases-"} | ||
> | ||
|
||
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> | ||
|
||
## Prerequisites | ||
|
||
In order to successfully complete this guide, you need: | ||
|
||
- [Node.js](https://nodejs.org/en/) installed on your machine | ||
- a [PostgreSQL](https://www.postgresql.org/) database server running | ||
|
||
> 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 ORM, check out the [Quickstart](/getting-started/quickstart). | ||
|
||
## Create project setup | ||
|
||
As a first step, create a project directory and navigate into it: | ||
|
||
```terminal copy | ||
mkdir hello-prisma | ||
cd hello-prisma | ||
``` | ||
|
||
Next, initialize a Node.js project and add the Prisma CLI as a development dependency to it: | ||
|
||
```terminal copy | ||
npm init -y | ||
npm install prisma --save-dev | ||
``` | ||
|
||
This creates a `package.json` with an initial setup for a Node.js app. | ||
|
||
<Admonition> | ||
|
||
See [installation instructions](/orm/tools/prisma-cli#installation) to learn how to install Prisma using a different package manager. | ||
|
||
</Admonition> | ||
|
||
You can now invoke the Prisma CLI by prefixing it with `npx`: | ||
|
||
```terminal | ||
npx prisma | ||
``` | ||
|
||
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 | ||
``` | ||
|
||
This command does two things: | ||
|
||
- creates a new directory called `prisma` that contains a file called `schema.prisma`, which contains the Prisma schema with your database connection variable and schema models | ||
- creates the [`.env` file](/orm/more/development-environment/environment-variables/env-files) in the root directory of the project, which is used for defining environment variables (such as your database connection) | ||
|
||
<NavigationLinksContainer isFirstLink> | ||
|
||
<ButtonLink | ||
color="dark" | ||
type="primary" | ||
href="./relational-databases/connect-your-database-node-postgresql" | ||
arrow | ||
> | ||
Connect your database | ||
</ButtonLink> | ||
|
||
</NavigationLinksContainer> |
Oops, something went wrong.