diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 32aff8c11a..873a29ff16 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -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" @@ -14,6 +15,7 @@ reviews: auto_review: enabled: true drafts: false + base_branches: [".*"] finishing_touches: docstrings: enabled: false diff --git a/.github/workflows/lychee.yml b/.github/workflows/lychee.yml index 72cf3fa499..0b705f533c 100644 --- a/.github/workflows/lychee.yml +++ b/.github/workflows/lychee.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/content/200-orm/200-prisma-client/000-setup-and-configuration/010-generating-prisma-client.mdx b/content/200-orm/200-prisma-client/000-setup-and-configuration/010-generating-prisma-client.mdx index fa86ed9fa5..8e7d257bf2 100644 --- a/content/200-orm/200-prisma-client/000-setup-and-configuration/010-generating-prisma-client.mdx +++ b/content/200-orm/200-prisma-client/000-setup-and-configuration/010-generating-prisma-client.mdx @@ -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: diff --git a/content/200-orm/500-reference/325-prisma-config-reference.mdx b/content/200-orm/500-reference/325-prisma-config-reference.mdx index 2ecf7bfdaf..d7a5492238 100644 --- a/content/200-orm/500-reference/325-prisma-config-reference.mdx +++ b/content/200-orm/500-reference/325-prisma-config-reference.mdx @@ -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 -``` \ No newline at end of file +``` + +## 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"), + }, + }); + ``` \ No newline at end of file