feat!: migrate yates to Prisma 7 with nested transaction support#136
Open
LucianBuzzo wants to merge 1 commit into
Open
feat!: migrate yates to Prisma 7 with nested transaction support#136LucianBuzzo wants to merge 1 commit into
LucianBuzzo wants to merge 1 commit into
Conversation
Summary - Upgrade Yates to Prisma 7 and migrate runtime/client setup to the Prisma Postgres adapter. - Replace legacy transaction workaround paths with Prisma 7-compatible extension behavior. - Add a migration guide and refresh README prerequisites/example for Prisma 7. - Expand integration coverage for nested interactive transaction scenarios and extension behavior. Why - Prisma 7 provides performance improvements and supports nested transactions needed by Yates. - Existing internals relied on older Prisma private/runtime behavior and became brittle or incompatible. - Consumers need a clear migration path for adapter config, Prisma config files, and test expectations. Details - Dependencies: upgraded `prisma` + `@prisma/client` to v7 and added `@prisma/adapter-pg` + `pg`. - Added `prisma.config.ts` for primary/secondary schemas and moved datasource URLs out of schema blocks. - Introduced `src/prisma-client.ts` factory using `PrismaPg` adapter. - Updated Yates transaction execution path to correctly reuse interactive transaction context. - Removed middleware-focused integration test and added extension-focused integration tests. - Added/expanded nested transaction tests (rollback, deep nesting, sequential nested tx, concurrent top-level tx with nested children). - Fixed Prisma 7 compatibility issues: - relation filter tokenization shape changes in expressions - pg_catalog raw query deserialization with explicit casts/selects - brittle exact error-message assertions in tests - Added `MIGRATION.md` and linked it from README. - Fixed Jest open-handle warning by ensuring test-created Prisma clients are tracked/disconnected and adapter config allows idle exit in test flows. Testing - npm run lint - npm run test:types - npm run test:integration
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐦⬛ Co-authored with Gravious.
Summary
This PR upgrades Yates to Prisma 7 and removes the legacy transaction workaround path in favor of Prisma 7-compatible behavior, while preserving Yates RLS guarantees.
Highlights
prisma,@prisma/client)@prisma/adapter-pg+pg)prisma.config.ts(primary + secondary schemas)Migration Guide
A full migration guide is included in this PR:
MIGRATION.mdIt covers:
prisma.config.ts)Breaking Changes
Validation
npm run lint✅npm run test:types✅npm run test:integration✅ (all suites passing)