docs(docs): add Neon to Prisma Postgres migration guide#7548
docs(docs): add Neon to Prisma Postgres migration guide#7548aidankmcalister wants to merge 3 commits intomainfrom
Conversation
Linear: DR-7110
WalkthroughAdds a new Postgres migration guide Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
🍈 Lychee Link Check Report3665 links: ✅ All links are working!Full Statistics Table
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx`:
- Around line 78-82: The .env example for DATABASE_URL is missing a database
name which can cause connection failures; update the `.env` snippet so
DATABASE_URL includes a placeholder DB name (e.g., .../:5432/DB_NAME?...) or
explicitly instruct readers to paste the exact direct connection string from the
Neon Console; ensure the `.env` sample and accompanying text reference the
DATABASE_URL variable and show where to put the database name or full direct
connection string.
- Around line 46-63: The example commands use literal quoted strings
("NEON_DATABASE_URL" / "PRISMA_POSTGRES_DATABASE_URL") which are not
copy/paste-safe; update the pg_dump and pg_restore invocations to use
shell-friendly placeholders or environment variable expansion instead (e.g.,
"$NEON_DATABASE_URL" or a clearly marked placeholder like <NEON_DATABASE_URL>),
and ensure the same change is applied to both the pg_dump command and the
pg_restore command so readers can paste and run them without replacing quotes or
breaking expansion.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/docs/content/docs/guides/postgres/meta.jsonapps/docs/content/docs/guides/postgres/migrate-from-neon.mdx
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx (1)
78-82:⚠️ Potential issue | 🟡 MinorThe
.envDATABASE_URLis missing a database name — connection will fail.Line 81 shows:
DATABASE_URL="postgres://USER:PASSWORD@db.prisma.io:5432/?sslmode=require"The path component between the port and the query string is empty (
/), so the URL contains no database name. Most PostgreSQL clients (including thepgdriver Prisma uses) fall back to the OS username as the database name when the path is absent, which will cause an immediate connection failure for almost every user who copy/pastes this.📝 Proposed fix
-DATABASE_URL="postgres://USER:PASSWORD@db.prisma.io:5432/?sslmode=require" +DATABASE_URL="postgres://USER:PASSWORD@db.prisma.io:5432/DBNAME?sslmode=require"Instruct readers to replace
DBNAME(or the full URL) with the exact direct connection string copied from the Prisma Console in step 1, which already carries the correct database name.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx` around lines 78 - 82, The example DATABASE_URL in the .env snippet is missing a database name and will fail; update the dotenv example so DATABASE_URL includes the actual database name (e.g., replace the empty path "/" with "/DBNAME") or, better, instruct readers to paste the full direct connection string copied from the Prisma Console into DATABASE_URL (so the DATABASE_URL value contains the correct host, port, database name and query params). Ensure the text references the .env DATABASE_URL example in the snippet and shows that the path component must include the database name.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx`:
- Line 50: Add a clear informational callout next to the reference to the -n
public flag explaining it restricts the dump to only the public schema and will
silently omit objects in other schemas; update the docs line that currently
shows "-n public" (and nearby explanatory text) to include a Note/Callout
stating: the -n public flag exports only the public schema, how to include
additional schemas with extra -n <schema> flags, or remove the flag to export
all schemas so users aren’t surprised by missing objects.
- Around line 44-52: The guide uses shell vars NEON_DATABASE_URL and
PRISMA_POSTGRES_DATABASE_URL in the pg_dump and pg_restore commands but never
tells readers to export them; add a short step after the connection-string
example that instructs readers to export the connection string into
NEON_DATABASE_URL (showing the example format used earlier) before running
pg_dump, and likewise instruct readers to export their direct connection string
into PRISMA_POSTGRES_DATABASE_URL before running pg_restore so the referenced
commands (pg_dump and pg_restore) will work as written.
---
Duplicate comments:
In `@apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx`:
- Around line 78-82: The example DATABASE_URL in the .env snippet is missing a
database name and will fail; update the dotenv example so DATABASE_URL includes
the actual database name (e.g., replace the empty path "/" with "/DBNAME") or,
better, instruct readers to paste the full direct connection string copied from
the Prisma Console into DATABASE_URL (so the DATABASE_URL value contains the
correct host, port, database name and query params). Ensure the text references
the .env DATABASE_URL example in the snippet and shows that the path component
must include the database name.
There was a problem hiding this comment.
♻️ Duplicate comments (2)
apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx (2)
44-52: Env var instructions are still ambiguous — readers won't know whether to substitute inline or export first.Line 44 says "replacing
$NEON_DATABASE_URLwith your actual Neon database URL", but thepg_dumpcommand treats it as a shell variable. A reader who follows the instruction literally would do an inline substitution and get a bare URL in the command, while the variable-expansion idiom requires anexportstep. Neither path is explained.The same gap exists on line 56 for
$PRISMA_POSTGRES_DATABASE_URL.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx` around lines 44 - 52, The docs instruct users to "replace `$NEON_DATABASE_URL`" but the shown pg_dump command uses a shell variable; update the text to explicitly show both supported options: (1) inline substitution by replacing `$NEON_DATABASE_URL` directly with the URL in the pg_dump command, and (2) exporting the variable first (export NEON_DATABASE_URL="your_url") and then running pg_dump "$NEON_DATABASE_URL"; do the same clarification for `$PRISMA_POSTGRES_DATABASE_URL` and reference the command name `pg_dump` and the variable names `NEON_DATABASE_URL`/`PRISMA_POSTGRES_DATABASE_URL` so readers know which approach to use.
50-50:-n publicsilently drops every non-public schema — a callout is still missing.There's no note warning readers that tables, types, functions, or sequences in schemas other than
publicwill be silently excluded from the dump.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx` at line 50, Add a clear callout immediately near the "-n public" flag explaining that using "-n public" causes pg_dump to silently exclude all tables, types, functions, and sequences in non-public schemas; instruct readers to either remove the "-n public" flag to include all schemas, or explicitly include additional schemas (or run separate dumps per schema) if they need non-public schema objects preserved. Ensure the callout references the "-n public" flag so readers know exactly which command option is dangerous.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx`:
- Around line 44-52: The docs instruct users to "replace `$NEON_DATABASE_URL`"
but the shown pg_dump command uses a shell variable; update the text to
explicitly show both supported options: (1) inline substitution by replacing
`$NEON_DATABASE_URL` directly with the URL in the pg_dump command, and (2)
exporting the variable first (export NEON_DATABASE_URL="your_url") and then
running pg_dump "$NEON_DATABASE_URL"; do the same clarification for
`$PRISMA_POSTGRES_DATABASE_URL` and reference the command name `pg_dump` and the
variable names `NEON_DATABASE_URL`/`PRISMA_POSTGRES_DATABASE_URL` so readers
know which approach to use.
- Line 50: Add a clear callout immediately near the "-n public" flag explaining
that using "-n public" causes pg_dump to silently exclude all tables, types,
functions, and sequences in non-public schemas; instruct readers to either
remove the "-n public" flag to include all schemas, or explicitly include
additional schemas (or run separate dumps per schema) if they need non-public
schema objects preserved. Ensure the callout references the "-n public" flag so
readers know exactly which command option is dangerous.
What changed and why
Adds a new guide covering how to migrate data from Neon to Prisma Postgres using
pg_dumpandpg_restore.Covers:
pg_dumppg_restore(using--no-ownerand--no-aclto avoid role errors from Neon-specific roles)Linear: DR-7110
Summary by CodeRabbit