Skip to content

Commit

Permalink
Merge branch 'main' into nurul3101-patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
jharrell authored Oct 11, 2024
2 parents 632538e + 16f0fd3 commit 69092e0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 22 deletions.
52 changes: 31 additions & 21 deletions .github/workflows/check-all-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,52 @@ permissions:

jobs:
check-for-absolute-urls:
name: "Check for absolute prisma.io urls"
name: "Check for dangerous urls"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: check for docs urls
- name: check docs urls
id: absolute-urls
run: |
FILES_WITH_ABS_URLS=$(grep -Erl "https://prisma\.io/docs|https://www\.prisma\.io/docs" content) || echo "no absolute URLs found."
OUTPUT="## Absolute URL check"$'\n'
FILES_WITH_LOCAL_URLS=$(grep -Prl "(?<!!)\[.+\]\(\..+\)" content) || echo "no local URLs found."
OUTPUT="## Dangerous URL check"$'\n'
SUCCESS=false
if [ -n "${FILES_WITH_ABS_URLS}" ]; then # if there were matching files
OUTPUT+="### Absolute URLs"$'\n'
OUTPUT+="The following files have absolute URLs to prisma.io/docs. Please replace them with relative URLs."$'\n'
OUTPUT+="Example: https://www.prisma.io/docs/getting-started/quickstart -> /getting-started/quickstart"$'\n'
for line in ${FILES_WITH_ABS_URLS}
do
OUTPUT+="${line}"$'\n'
done
OUTPUT+=""$'\n'
else
# no matching files
OUTPUT+="No absolute URLs to prisma.io/docs found."
OUTPUT+="No absolute URLs to prisma.io/docs found."$'\n'
SUCCESS=true
fi
if [ -n "${FILES_WITH_LOCAL_URLS}" ]; then
OUTPUT+="### Local URLs"$'\n'
OUTPUT+="The following files have local URLs. Please remove any leading dots."$'\n'
OUTPUT+="Example: ./getting-started/quickstart -> /getting-started/quickstart"$'\n'
for line in ${FILES_WITH_LOCAL_URLS}
do
OUTPUT+="${line}"$'\n'
done
else
OUTPUT+="No local URLs found."$'\n'
SUCCESS=true
fi
# check success
if [ -n "${FILES_WITH_ABS_URLS}" ] || [ -n "${FILES_WITH_LOCAL_URLS}" ]; then
SUCCESS=false
else
SUCCESS=true
fi
# https://github.com/orgs/community/discussions/26288#discussioncomment-3876281
{
echo 'body<<EOF'
Expand All @@ -59,8 +82,8 @@ jobs:
exit 1;
fi
check-for-dead-external-links:
name: Check external links
check-for-dead-links:
name: Check links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -74,27 +97,14 @@ jobs:
- name: Install remark presets
run: npm install remark-lint-no-dead-urls remark-custom-header-id

- name: run remark-cli
- name: Check external links (remark-cli)
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
npx remark-cli . -qf -e=md,mdx --use remark-mdx --use remark-custom-header-id --use remark-frontmatter --use remark-gfm \
--use "remark-lint-no-dead-urls=skipLocalhost:true,skipUrlPatterns:['https://www.notion.so/prismaio','https://www.prisma.io/docs','https://dash.cloudflare.com','https://www.cloudflare.com']"
check-for-dead-internal-links:
name: Check internal links
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18

- name: Install deps
run: npm install

- name: test build
- name: Check internal links (docusaurus build)
env:
DOCUSAURUS_POST_HOG_KEY: ${{ secrets.DOCUSAURUS_POST_HOG_KEY }}
run: npm run clean && npm run build
Expand Down
2 changes: 1 addition & 1 deletion content/300-accelerate/500-known-limitations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Accelerate is designed to work with high-performance, low-latency queries. It is

For queries that cannot be optimized or pared down, we recommend one of two solutions:

1. **Use the read replica extension**: The Prisma ORM [read replica extension](https://www.npmjs.com/package/@prisma/extension-read-replicas/v/0.2.1) allows you to set up two different connections: a `primary` and a `replica`. You can set up your Accelerate connection as the `primary` and then a direct connection as the `replica`. Any queries that are resource-intensive or long-running can then be routed to the `replica`, while the `primary` (your Accelerate connection) will handle normal queries. **Please note** that this solution requires you to both set up a direct connection and requires the full generated Prisma Client (i.e. without `--no-engine`).
1. **Use the read replica extension**: The Prisma ORM [read replica extension](https://www.npmjs.com/package/@prisma/extension-read-replicas) allows you to set up two different connections: a `primary` and a `replica`. You can set up your Accelerate connection as the `primary` and then a direct connection as the `replica`. Any queries that are resource-intensive or long-running can then be routed to the `replica`, while the `primary` (your Accelerate connection) will handle normal queries. **Please note** that this solution requires you to both set up a direct connection and requires the full generated Prisma Client (i.e. without `--no-engine`).

2. **Separate analytics queries**: Our preferred solution is to separate your analytics queries into a separate application. This separate application can then use a direct connection so that it can run heavy queries without impacting the performance or cost of your Accelerate-powered application.

Expand Down

0 comments on commit 69092e0

Please sign in to comment.