Repository navigation
Prisma Postgres guide: update the Prisma ORM section to Prisma ORM 8 - #14835
ankur-arch wants to merge 2 commits into
Conversation
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
Hello! Thank you for opening your first PR to Astro’s Docs! 🎉 Here’s what will happen next:
|
|
Preview deployment 🔄 Deployment in progress...
|
ArmandPhilippot
left a comment
There was a problem hiding this comment.
Thank you, @ankur-arch! 🙌🏽 I'm glad we receive help from Prisma to update the guide!
I left a few suggestions:
- for the aside and the Node.js version to make long-term maintenance easier
- a few nits regarding the order or our writing styles
I don't think we need to say here that Prisma ORM 8 is still a release candidate. But, if you think this is important, maybe we should just wait for the final release if it's coming soon.
|
Thanks for the careful review, @ArmandPhilippot! All six suggestions are applied in 7696abf. On the release candidate question: agreed, the page does not need to mention it. |
Description (required)
Follow-up to #14664, which pinned this guide to Prisma ORM 7 as an interim fix. This updates the "Connect with Prisma ORM" section to Prisma ORM 8, the version an unpinned
npm install prismaresolves to today, as #14605 preferred.What changes for readers:
npx prisma@latest orm init --target postgres --authoring psl, which installs the packages and writesprisma.config.ts,src/prisma/contract.prismaandsrc/prisma/db.ts. The guide no longer hand-writessrc/lib/prisma.ts.npx create-db@latest --env .envreplacesprisma init --dbfor creating the Prisma Postgres database (that flag does not exist in the ORM 8 CLI, which is what Prisma Postgres guide is outdated #14605 ran into).prisma generate/prisma migrate devbecomeprisma contract emit/prisma db init(withprisma db updatefor later changes).db.orm.public.Post.where(...).orderBy(...).all()).The "Connect with Other ORMs and Libraries" section is untouched. Links are to Prisma's canonical docs pages with no tracking parameters. Happy to keep a collapsed ORM 7 section instead of the note if you would rather not drop the pinned instructions yet.
Testing (Astro 7.4.5,
@astrojs/nodestandalone, Node 24.11, Prisma CLI 8.0.0-rc.30,@prisma/orm-postgres8.0.0-rc.22, a real Prisma Postgres database):Starting from
npm create astro@latest -- --template minimalplusastro add node, I ran every command in the guide in order, pasted thePostmodel andsrc/pages/posts.astroexactly as written, inserted a published and an unpublished post, and confirmedastro buildsucceeds and/postsrenders only the published post from bothastro previewandastro dev. I then deleted the project and repeated the whole sequence once more from scratch to catch missing steps.References
Disclosure: I work at Prisma.