Upgrade to Prisma 7 with database adapter support#132
Merged
Conversation
## Changes ### Core - Made `prismaClientConstructor` required in DatabaseConfig - Updated type definitions with comprehensive adapter examples - Added helpful error messages for missing adapter configuration ### CLI - Updated Prisma schema generator to use `prisma-client` provider - Removed `url` field from datasource block generation - Updated context generator to require and use `prismaClientConstructor` - Added error message with SQLite adapter example when constructor missing ### Examples (12 total) - Added adapter dependencies to all example package.json files - Updated all opensaas.config.ts files with `prismaClientConstructor` - SQLite examples: Added @prisma/adapter-better-sqlite3 + better-sqlite3 - PostgreSQL example: Added @prisma/adapter-pg + pg - Regenerated all Prisma schemas with new format ### Templates - Updated create-opensaas-app templates with adapter configuration - Both basic and with-auth templates now include required adapters ### Tests - Fixed RAG plugin tests with mock adapter configs - Fixed CLI generator tests with required prismaClientConstructor - Updated 11 test snapshots to match new generated code - All tests passing ### Documentation - Updated CLAUDE.md with Prisma 7 requirements and examples - Updated CLI CLAUDE.md with new schema format - Added examples for SQLite, PostgreSQL, and Neon adapters 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 5f838ab The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Remove outdated Prisma schema datasource example from deployment.md - Clarify prismaClientConstructor is required in config.md - Update database adapter documentation
- Removed url from DatabaseConfig type definition - Database connection URLs now passed directly to adapters - Updated all 12 examples to pass url to adapters - Updated 2 templates (basic, with-auth) - Updated all test mocks to remove url field - Updated config.md API reference documentation - Updated changeset to document url removal Breaking Change: The url field is no longer part of the db config object. Connection URLs are now passed directly to database adapters in prismaClientConstructor.
- Add eslint-disable comments for test mock constructors - Remove unused error variables in catch blocks - Prefix unused variable with underscore - Remove unused imports - Fix syntax errors (missing commas)
Contributor
Coverage Report for RAG Package Coverage (./packages/rag)
File CoverageNo changed files found. |
Contributor
Coverage Report for Storage Vercel Package Coverage (./packages/storage-vercel)
File CoverageNo changed files found. |
Contributor
Coverage Report for UI Package Coverage (./packages/ui)
File CoverageNo changed files found. |
Contributor
Coverage Report for CLI Package Coverage (./packages/cli)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
Coverage Report for Core Package Coverage (./packages/core)
File CoverageNo changed files found. |
Contributor
Coverage Report for Storage Package Coverage (./packages/storage)
File CoverageNo changed files found. |
Contributor
Coverage Report for Storage S3 Package Coverage (./packages/storage-s3)
File CoverageNo changed files found. |
Contributor
Coverage Report for Auth Package Coverage (./packages/auth)
File CoverageNo changed files found. |
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.
Summary
This PR upgrades OpenSaas Stack to Prisma 7, which requires database adapters for all database connections.
Breaking Changes
Required
prismaClientConstructorPrisma 7 no longer supports the
urlfield in the datasource block. Instead, database connections must be configured via adapters passed to the PrismaClient constructor.All configs must now include
prismaClientConstructor:Generated Schema Changes
prisma-client-jstoprisma-clienturlfield from datasource blockprismaClientConstructorChanges Made
Core (
@opensaas/stack-core)prismaClientConstructorrequired inDatabaseConfigtypeCLI (
@opensaas/stack-cli)prisma-clientproviderurlgeneration from datasource blockprismaClientConstructorExamples (12 total)
@prisma/adapter-better-sqlite3@prisma/adapter-pgprismaClientConstructorTemplates (
create-opensaas-app)Tests
prismaClientConstructorMigration Guide for Users
1. Install Prisma 7 and adapter
2. Update opensaas.config.ts
Add
prismaClientConstructorto your db config (see examples above in Breaking Changes section).3. Regenerate schema and client
4. Push schema to database
Testing
url, usesprisma-client)prismaClientConstructor)References
🤖 Generated with Claude Code