using prisma along with drizzle/kysley
Prob dumb, but would i face any issues if i use both prisma and kysley/drizzle in the same app. (I wont run out of connections or anything right?).
Also assuming single prisma schema would serve for both, cba to maintain multiple schemas.
(Reason is so that i can use vercel edge runtime)
6 Replies
I would avoid using multiple ORMs/query builders in the same project, if you can. I've done it before and it usually ends in headache. It's best to pick one and commit to it.
Quite a lot of query already uses prisma, so itd be a nightmare to now shift the whole thing to something else.
And i only need kysley/drizzle for like 3-4 endpoints. Just so i can use the edge runtime.
Ive seen juliuss acme-corp repo which uses prisma for schema, and kysley for querying, but im kinda curious if itll lead into issues later if i use both for querying
What all issues did u run into?
spend 15mins w. kysley and realised im not good enough for it.
prob drizzle then
I have a few projects where I use Prisma for schema management and Kysely for query building. Unless you’re comfortable with SQL and database management, I would suggest just going with Prisma for schemas and query building or Drizzle.
If edge runtimes are a real requirement in your project, I would probably go for Drizzle to be honest. It sounds like you’re not too comfortable with SQL yet, so I think Drizzle would be a good fit.
Yes, drizzle was my first choice even. But couldnt find any extension or anything which can generate types from prisma schema
Not sure about generating Drizzle types from Prisma, but you can definitely generate Kysely types from Prisma: https://github.com/valtyr/prisma-kysely
GitHub
GitHub - valtyr/prisma-kysely: 🪄 Generate Kysely types directly fro...
🪄 Generate Kysely types directly from your Prisma schema! - valtyr/prisma-kysely
yea, i used this, spent some time w. kysley and realised im not good enough w. raw sql lmao
i managed to generate the types in drizzle by pulling from db, wrote an existing query, still prisma generated one managed to do better kek.
fuck im so bad at raw sql