W
Wasp•4mo ago
Zeke

Prisma Postgres + Wasp?

I want to use Prisma Postgres, their hosted Postgres service, but it's wanting me to run some commands to enable Accelerate. Is this okay to do with Wasp? I recall the docs saying to only run Prisma commands through the Wasp CLI, so I wanted to double check.
8 Replies
kapa.ai
kapa.ai•4mo ago
Hi @Zeke. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
MEE6
MEE6•4mo ago
Wohooo @Zeke, you just became a Waspeteer level 4!
kapa.ai
kapa.ai•4mo ago
---------------------- Wasp uses Prisma as its ORM and provides its own set of database commands (e.g., wasp db migrate-dev) that wrap Prisma commands. The Wasp documentation and issues recommend running database-related commands through the Wasp CLI, as this ensures Wasp can manage the workflow and environment correctly. This is especially important because Wasp sometimes needs to do extra work before or after running Prisma commands, and running Prisma commands directly could bypass this logic or cause confusion, particularly with migrations and code generation steps Database Commands Github Issue #216. Regarding Prisma's Accelerate or enabling features on a hosted Postgres service: the knowledge sources do not mention Prisma Accelerate specifically, nor do they provide guidance on running Prisma CLI commands directly for enabling such features. However, there is ongoing discussion in the Wasp community about exposing more direct access to Prisma CLI via wasp prisma ... for advanced use cases, but this is not yet standard or fully documented Github Issue #216. Summary:
- For standard database operations (migrations, seeding, etc.), use the Wasp CLI. - For advanced Prisma features (like enabling Accelerate), the knowledge sources do not provide explicit guidance. If these require running Prisma CLI commands directly, proceed with caution, as this may not be fully supported by Wasp at this time. - If possible, check if the required steps can be integrated into your Wasp workflow, or ask the Wasp community for the latest recommendations. If you need to enable a Prisma feature that is not yet exposed via Wasp, you may need to experiment or wait for official support. The knowledge sources do not explicitly confirm or deny compatibility with Prisma Accelerate or similar features. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Zeke, 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?
Filip
Filip•4mo ago
Hey @Zeke, which commands do you need to run? Paste them here and I'll tell you whether they're OK. In general, anything you run on the database should be fine. The problem is with the commands that generate code and do migrations - Wasp must know about those for TS and caching purposes.
Zeke
ZekeOP•4mo ago
It's these steps: https://www.prisma.io/docs/accelerate/getting-started#22-install-the-accelerate-prisma-client-extension It's an extension/generation, so I'm not sure Afaik there's no way to use Prisma Postgres without Accelerate
Filip
Filip•4mo ago
Hmm, I think the generate command might work on their own 1. You would edit the Prisma schema and install the necessary extensions 2. Wasp uses Prisma 5.19 and calls prisma generate under the hood, so that should work automatically Wasp could possibly prevent you from using step 1 but I think it will be ok (we support Prisma extensions I believe). The main problem is in this step: 3. Extend your Prisma Client instance with the Accelerate extension We have not yet released the support for extending Prisma client. It's almost done and scheduled for the next release in a week or two. So the question is: Do steps 1 and 2 work? If so, could you make it work without extending the Prisma client (step 3). If steps 1 and 2 work but step 3 is also a must, I could cook up a special nighly build for you as soon as we merge it. Let me know if that helps
Zeke
ZekeOP•4mo ago
I'm using Neon for right now for dev, so I'm fine with waiting until support for extending is released. thanks!
Filip
Filip•4mo ago
Ok, great, keep up with our releases 🙂 Should be in the next one

Did you find this page helpful?