-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
validateUniquess optional prismaClient parameter #5763
validateUniquess optional prismaClient parameter #5763
Conversation
✅ Deploy Preview for redwoodjs-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably update the docs as well to let people know this is now an option!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I'll take a crack at documentation updates now and change the name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though, the way it's implemented there's definitely only support for a Prisma Client, right? It explicitly is using the $transaction
prop. I think this particular help is specific to a Prisma. The docs even say it's an experimental feature for Prisma already.
Yeah it's only Prisma for now, but you never know! Plus we use |
@cannikin , Do you all have preferences for commit histories? Are you squashing and committing or would you like me to rebase and squash my commits separately so you can merge? |
You can just leave everything as individual commits, we do a squash and merge when we approve the PR! |
…github.com:LeftLaneSoftware/redwood into AF-validateUniques_optional_prismaClient_parameter
What is the failing "Only doc changes?" check about? Am I not updating something for the docs change? |
LGTY @cannikin ? I think this is ready to merge |
…github.com:LeftLaneSoftware/redwood into AF-validateUniques_optional_prismaClient_parameter
@AlejandroFrias Added a comment to that one code block, wondering if now that |
@alejandro-myriad Can pull down the latest |
Nevermind, tests passed! |
…ctmode-gen * 'main' of github.com:redwoodjs/redwood: validateUniquess optional prismaClient parameter (redwoodjs#5763) fix(deps): update dependency prettier to v2.7.1 (redwoodjs#5808) fix(deps): update dependency eslint to v8.18.0 (redwoodjs#5806) fix(deps): update dependency systeminformation to v5.11.21 (redwoodjs#5805) fix(deps): update dependency @apollo/client to v3.6.9 (redwoodjs#5804) chore(deps): update dependency firebase to v9.8.3 (redwoodjs#5799) Add Azure AD B2C auth provider compatibility (redwoodjs#5781) chore(deps): update dependency esbuild to v0.14.47 (redwoodjs#5798) Maps JSON GraphQL Scalars to Prisma Json field types for compatibility (redwoodjs#5796) fix(deps): update prisma monorepo to v3.15.2 (redwoodjs#5789) fix(deps): update dependency core-js to v3.23.2 (redwoodjs#5790) fix(deps): update dependency webpack to v5.73.0 (redwoodjs#5755) docs: update disable api layer/database to include disabling prisma (redwoodjs#5528) Fix typo in testing docs (redwoodjs#5782) fix typo (redwoodjs#5777) docs: Replacing Prisma.xxx types with types from 'types/graphql' (redwoodjs#5740) Reorganize auth docs into sub-categories (redwoodjs#5787)
…b-issue-forms * 'main' of github.com:redwoodjs/redwood: (40 commits) Update link to auth/providers implementations (#5826) fix(deps): update dependency qs to v6.11.0 (#5836) Docs -> Tutorial - Update comment-form.md - Minor Typo (#5837) fix: have user config for `addons` and `stories` take precedence (#5780) chore(deps): update dependency @tsconfig/docusaurus to v1.0.6 (#5834) chore(deps): update dependency @auth0/auth0-spa-js to v1.22.1 (#5831) Fix misnamed forbidden page route (#5832) fix(deps): update dependency concurrently to v7.2.2 (#5830) Router tests: More advanced auth mock (#5742) fix(deps): update dependency react-hook-form to v7.33.0 (#5809) fix(deps): update dependency qs to v6.10.5 (#5829) fix some grammar issues (#5778) fix(deps): update dependency ci-info to v3.3.2 (#5828) validateUniquess optional prismaClient parameter (#5763) fix(deps): update dependency prettier to v2.7.1 (#5808) fix(deps): update dependency eslint to v8.18.0 (#5806) fix(deps): update dependency systeminformation to v5.11.21 (#5805) fix(deps): update dependency @apollo/client to v3.6.9 (#5804) chore(deps): update dependency firebase to v9.8.3 (#5799) Add Azure AD B2C auth provider compatibility (#5781) ...
Discord thread started: https://discord.com/channels/679514959968993311/716252919875240007/984849006511394816
Per the prisma docs, you can programmatically override the datasource's url when instantiating a new
PrismaClient
.uniquenessValidator
util is creating its ownPrismaClient
to wrap the transaction in, which will not respect any overrides you are setting in theapi/src/lib/db.ts
file. This is fine when you haven't customized anything, so seems ok for a default. This PR is adding an option to allow passing in your ownPrismaClient
to use instead in the event you are customizing it.