Skip to content

Conversation

@lsmith77
Copy link

@lsmith77 lsmith77 commented Jan 21, 2026

fixes #605
see also zenstackhq/zenstack-docs#555

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved database feature detection for schema generation to intelligently enable appropriate preview features based on actual datasource configuration, including multi-schema support and database extensions.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

The change modifies the Prisma schema generator to intelligently detect and activate preview features based on datasource configuration. It now conditionally enables multiSchema when schemas exist and postgresqlExtensions when extensions are present, replacing the previous unconditional extension-only approach.

Changes

Cohort / File(s) Summary
Prisma Schema Feature Detection
packages/sdk/src/prisma/prisma-schema-generator.ts
Replaces single-feature toggle with generalized feature detection. Now conditionally populates previewFeatures with multiSchema and/or postgresqlExtensions based on datasource configuration, supporting both schema and extension preservation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Through multiple schemas we skip and we stride,
Features detected with careful delight,
What once slipped away now stays at our side,
Each schema and extension shines ever so bright! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The PR partially addresses issue #605 by enabling the multiSchema preview feature when schemas exist, but the changes shown only cover feature flag activation, not preservation of @@Schema attributes or datasource.schemas array. Verify that the complete PR implementation includes logic to preserve datasource.schemas arrays and @@Schema() model attributes, not just preview feature flags.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: enabling Prisma's multiSchema preview feature when necessary, which directly addresses the linked issue about preserving multi-schema configuration.
Out of Scope Changes check ✅ Passed The changes to prisma-schema-generator.ts are directly scoped to resolving issue #605 by enabling appropriate Prisma preview features for multi-schema support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lsmith77
Copy link
Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

@@schema is not preserved in schema.prisma generation

1 participant