Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
# yaml template to refer to https://docs.coderabbit.ai/reference/yaml-template#enterprise
language: "en-US"
tone_instructions: "You are a principal engineer with natural teaching abilities. You detect issues and clearly explain why."
reviews:
collapse_walkthrough: false
profile: "chill"
Expand All @@ -14,6 +15,7 @@ reviews:
auto_review:
enabled: true
drafts: false
base_branches: [".*"]
finishing_touches:
docstrings:
enabled: false
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/lychee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
--cache
--cache-exclude-status 429,500,502,503,504
--max-cache-age 5m
--verbose
--no-progress
--accept 200,201,204,304,403,429
--timeout 20
Expand All @@ -50,7 +49,6 @@ jobs:
args: >
--cache
--max-cache-age 5m
--verbose
--no-progress
--accept 200,201,204,304,403,429
--cache-exclude-status 429,500,502,503,504
Expand Down Expand Up @@ -79,8 +77,8 @@ jobs:
fi

if [ -n "$REPORT_FILE" ]; then
# Read the original output
ORIGINAL=$(cat "$REPORT_FILE")
# Read the original output and remove everything after 'Redirects per input'
ORIGINAL=$(cat "$REPORT_FILE" | sed '/^##* Redirects per input/,$d')

# Create formatted output
cat > lychee/formatted.md << EOF
Expand All @@ -92,7 +90,7 @@ jobs:

EOF

# Append the original content with title replacement
# Append the cleaned content with title replacement
echo "$ORIGINAL" | sed 's/^# Summary$//' | sed 's/^## Summary$//' >> lychee/formatted.md
fi

Expand Down
21 changes: 1 addition & 20 deletions content/100-getting-started/01-quickstart-prismaPostgres.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,7 @@ At this point, you'll be redirected to the **Database** page where you will need

Once the green **`CONNECTED`** label appears, your database is ready to use!

## 2. Download example and install dependencies

Copy the `try-prisma` command that's shown in the Console, paste it into your terminal and execute it.

For reference, this is what the command looks like:

```terminal
npx try-prisma@latest \
--template databases/prisma-postgres \
--name hello-prisma \
--install npm
```

Once the `try-prisma` command has terminated, navigate into the project directory:

```terminal
cd hello-prisma
```

## 3. Set database connection URL
## 2. Set database connection URL

The connection to your database is configured via an environment variable in a `.env` file.

Expand Down
2 changes: 0 additions & 2 deletions content/100-getting-started/01-quickstart-sqlite.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ Models in the Prisma schema have two main purposes:
- Represent the tables in the underlying database
- Serve as foundation for the generated Prisma Client API

In the next section, you will map these models to database tables using Prisma Migrate.

## 3. Run a migration to create your database tables with Prisma Migrate

At this point, you have a Prisma schema but no database yet. Run the following command in your terminal to create the SQLite database and the `User` and `Post` tables represented by your models:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,35 @@ For improved compatibility with ECMAScript modules (ESM) and to ensure consisten

:::

## Loading environment variables

To load environment variables in your Prisma application, you can use the `prisma.config.ts` file along with the `env` helper from `prisma/config`. This approach provides better type safety and configuration management.

1. First, install the required dependency:

```bash
npm install dotenv --save-dev
```

2. Create a `.env` file in your project root (if it doesn't exist) and add your database connection string:

```env
DATABASE_URL="your_database_connection_string_here"
```

3. Update your `prisma.config.ts` file in your project root:

```ts
import "dotenv/config";
import { defineConfig, env } from "prisma/config";

export default defineConfig({
datasource: {
url: env("DATABASE_URL"),
},
});
```

## The `@prisma/client` npm package

The `@prisma/client` npm package consists of two key parts:
Expand Down
31 changes: 30 additions & 1 deletion content/200-orm/500-reference/325-prisma-config-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -597,4 +597,33 @@ You can specify a custom location for your config file when running Prisma CLI c

```terminal
prisma validate --config ./path/to/myconfig.ts
```
```

## Loading environment variables

To load environment variables in your Prisma application, you can use the `prisma.config.ts` file along with the `env` helper from `prisma/config`. This approach provides better type safety and configuration management.

1. First, install the required dependency:

```bash
npm install dotenv --save-dev
```

2. Create a `.env` file in your project root (if it doesn't exist) and add your database connection string:

```env
DATABASE_URL="your_database_connection_string_here"
```

3. Update your `prisma.config.ts` file in your project root:

```ts
import "dotenv/config";
import { defineConfig, env } from "prisma/config";

export default defineConfig({
datasource: {
url: env("DATABASE_URL"),
},
});
```
Loading