This looks great and should surely cover most of the CRUD needs of simpler apps and hopefully even more.
On the other hand, in my experience such complicated abstractions eventually leak, especially due to the complicated nature of the relational model and modern SQL.
For developers not keen on adding a thick indirection layer between the app and the DB, I have been trying to make raw SQL easier and more reliable to use directly in TS with PgTyped[1].
In general, I think most people are more than glad to use raw SQL solution instead of a mapper as long as it has:
1) Realtime parameter/result type inference in their language of choice.
2) Has autocomplete and validation in their IDE
3) Is composable, allowing to join queries/sub-queries..
So far I have been able to implement SQL-in-TS type inference in PgTyped[1] with autocomplete and validation on the way.
pgtyped looks awesome, fantastic work! We're huge fans of type-safety at Prisma so anything that makes working with DBs type-safe is right down our alley! :D
I think one thing that distinguishes Prisma (on the longer run) from a library like pgtyped is that Prisma will enable more database workflows than just database access. With Prisma Migrate, you can alter your DB schema and keep a migration history, Prisma Studio will enable lots of DB workflows on a GUI level, and Prisma Cloud will have great integrations for teams and larger scale organizations eventually.
All that being said, because Prisma is a DB toolkit, you can also pick and choose any tools you like from it. Nothing would e.g. speak against using Prisma Migrate to run your schema migrations but keep accessing your DB with pgtyped, in fact I think this would be an awesome combination :)
For developers not keen on adding a thick indirection layer between the app and the DB, I have been trying to make raw SQL easier and more reliable to use directly in TS with PgTyped[1].
In general, I think most people are more than glad to use raw SQL solution instead of a mapper as long as it has:
1) Realtime parameter/result type inference in their language of choice.
2) Has autocomplete and validation in their IDE
3) Is composable, allowing to join queries/sub-queries..
So far I have been able to implement SQL-in-TS type inference in PgTyped[1] with autocomplete and validation on the way.
[1]: https://github.com/adelsz/pgtyped