W
Wasp•5mo ago
NEROX

Split schema.prisma?

maybe sounds weird split a DB but mine its getting kinda long (like my main.wasp but this I can split with the TSX config)
Solution:
@NEROX Yep, it makes sense! Unfortunately, as the bot says, it's not possible right now.
Jump to solution
4 Replies
kapa.ai
kapa.ai•5mo ago
Hi @NEROX. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Currently, Wasp does not support splitting the generated Prisma schema (schema.prisma) into multiple files. The schema.prisma file is auto-generated by Wasp based on your entity definitions in main.wasp, and there is no documented way to modularize or split this file within the Wasp workflow. While there is active discussion and demand for splitting main.wasp into multiple files for better maintainability (and this feature is planned for the future), there is no mention in the knowledge sources of a similar feature for schema.prisma. All Prisma-related configuration and entity definitions must remain in main.wasp, and Wasp will generate a single schema.prisma file from that source. If your schema is getting long, the only current way to manage complexity is by organizing your main.wasp and related TypeScript/JavaScript files as best as possible, but not the Prisma schema itself. If you need to customize the Prisma schema directly, be aware that manual changes to the generated schema.prisma will be overwritten the next time Wasp regenerates it, so this is not a recommended or supported workflow. In summary: Splitting schema.prisma is not supported in Wasp, and there is no official workaround documented in the current knowledge sources. If you are finding your main.wasp or schema.prisma too large, you may need to wait for future updates that address modularization, at least for main.wasp. For now, schema.prisma will remain a single file generated by Wasp from your main.wasp definitions. For more on splitting main.wasp, see the related discussions: Discord thread: Can I split up the main.wasp file into separate files, Github Issue: Split file main.wasp. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @NEROX, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Solution
Carlos
Carlos•5mo ago
@NEROX Yep, it makes sense! Unfortunately, as the bot says, it's not possible right now.
Carlos
Carlos•5mo ago
It's on our radar, we're tracking the issue at https://github.com/wasp-lang/wasp/issues/2397, but we haven't yet picked it up 😅
GitHub
wasp-lang/wasp
The fastest way to develop full-stack web apps with React & Node.js. - wasp-lang/wasp
NEROX
NEROXOP•5mo ago
Great! Nice that is already in the radar🥳

Did you find this page helpful?