We're planning to use several postgres features that aren't well supported by Prisma, so we should investigate alternative sql query builders that will let us work with materialized views and json columns without losing type safety. The Prisma client also offers very little control over the actual queries, which will be challenging for us as we try to optimize them.
We're planning to use several postgres features that aren't well supported by Prisma, so we should investigate alternative sql query builders that will let us work with materialized views and json columns without losing type safety. The Prisma client also offers very little control over the actual queries, which will be challenging for us as we try to optimize them.
https://kysely.dev/ seems like a strong contender and they recommend https://github.com/kristiandupont/kanel/tree/main/packages/kanel-kysely to generate types via database introspection. This would be compatible with our existing Prisma schema generation.
Another one is Drizzley ORM.
In the long term, we might consider replacing Prisma entirely, since it seems the schema/migrations are also somewhat limited and designed in a way that doesn't really match how we'd like to work: https://github.com/prisma/prisma/issues/6974#issuecomment-1483792245