Skip to content

chore: add client extensions examples to existing Prisma Client sections - #4515

Closed
ruheni wants to merge 58 commits into
mainfrom
client-extensions
Closed

chore: add client extensions examples to existing Prisma Client sections#4515
ruheni wants to merge 58 commits into
mainfrom
client-extensions

Conversation

@ruheni

@ruheni ruheni commented Feb 13, 2023

Copy link
Copy Markdown
Contributor

Describe this PR

Closes #4481

Add Prisma Client extension examples to existing workarounds:
Show an example with Prisma Client Extensions on the page

  • Computed fields
  • Custom validation
  • Custom models methods

Removed from the PR

  • exists function
  • JSON field type validation
  • ~~Middleware migration to Client extensions: ~~
    • soft delete (Update when support for nesting is added)
    • query logging
    • session data (RLS?)
  • RLS
  • Move PCE a level above Middleware?
  • Set up redirects for old pages

Examples marked with ~~ are currently out of scope for v1.

Alternative idea:
Convert the Prisma Client extensions GH repo to resemble the Prisma Examples repo — in terms of structure and purpose.
The repository can serve as a reference + dump for PCE ideas + contributions from other users.
Create a page to aggregate the list of all extensions in the repository — name and descriptions

Note: Closed in favor of #4719

@vercel

vercel Bot commented Feb 13, 2023

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ❌ Failed (Inspect) Apr 27, 2023 5:01pm
docs-gjpx ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 27, 2023 5:01pm

@github-actions

github-actions Bot commented Feb 13, 2023

Copy link
Copy Markdown
Contributor

This PR changes the following pages (Vercel Preview Deploy links):

Changed Vercel links

(Note that links will only be valid after Vercel preview deploy succeeded)

@ruheni ruheni changed the title chore: add client extensions example to existing Prisma Client sections chore: add client extensions examples to existing Prisma Client sections Feb 14, 2023
@ruheni
ruheni marked this pull request as ready for review February 17, 2023 10:36

@nikolasburk nikolasburk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, I've left a few small comments but once there are incorporated, this is ready to merge 🚀

Comment thread content/200-concepts/100-components/02-prisma-client/061-custom-validation.mdx Outdated
Comment thread content/200-concepts/100-components/02-prisma-client/061-custom-validation.mdx Outdated
Comment thread content/200-concepts/100-components/02-prisma-client/061-custom-validation.mdx Outdated
<tab>

```ts copy
// A post with invalid input — missing the title field

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's nice that you're showing an example query here, but I don't find it too helpful without further context and hidden in the tabs. how is it going to help someone reading this page understand validation better?

it would be more helpful IMO if:

  • the query wasn't hidden in a tab
  • there were two scenarios shown: one with a valid input one another one with an invalid input, including an explanation of the expected error

Comment thread content/200-concepts/100-components/02-prisma-client/062-computed-fields.mdx Outdated
Co-authored-by: Nikolas <nikolas.burk@gmail.com>
@ruheni ruheni closed this Apr 27, 2023
@janpio
janpio deleted the client-extensions branch November 15, 2023 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link to PCE blog post from the docs

3 participants