Skip to content
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

Add support for multiple-file prisma schema #76

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

togo01
Copy link
Contributor

@togo01 togo01 commented Feb 7, 2025

This PR introduces support for split Prisma schemas by automatically merging .prisma files located within the schema directory. This enhancement improves the visualization of schemas in the graph, allowing for a more organized and flexible schema structure.

Changes Made:

Auto-Merging Functionality: Added logic to publishSchema in packages/extension-shared/extension/views/panel.ts to check for .prisma files within the schema directory and merge them if found.
Async Method Update: Converted publishSchema to an async method to utilize workspace.findFiles and workspace.fs.readFile for file operations.
Type Adjustment: Added void to the call of MainPanel.publishSchema to prevent compilation errors without affecting existing functionality.

Impact:

No Regression: The changes do not affect current functionality.
Improved Support: Enables proper handling of split schema files, enhancing the user experience for those organizing schemas in multiple files within the schema directory.

Testing:

The changes have been tested to ensure correct merging and display of split schemas. Further testing is welcome to confirm functionality across different setups.

Conclusion:

This PR enhances the Prisma schema handling, offering better support for split schemas. I appreciate your consideration and look forward to your feedback.

Thank you for your attention, and I hope this improvement can be included in an upcoming release.

Best regards,

Togo01

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.

1 participant