If your app has the occasional custom backend logic, you can spin up a separate server (or edge function) to handle those one-offs endpoints.
Already PostGREST is getting complicated, additions like this will make it less attractive to me.
This feature[1] actually simplified a lot and removed a lot of magic assumptions in the PostgREST codebase. It goes in line with REST as well — SQL functions are REST resources and HTML is just another representation for them.
Most of the code you see here is pure SQL and plpgSQL. The only PostgREST-specific part is the CREATE DOMAIN.
Right now most users view PostgREST as a HTTP->JSON->SQL->JSON->HTTP service and we're trying to turn that into HTTP->SQL->HTTP. If that's not some true top level simplification, I don't know what is!
[1]: https://postgrest.org/en/stable/references/api/media_type_ha...
That’s how everyone used to build apps before Rails came along and made everone think putting biz logic into a slow server side language was a good idea.
Some DBAs I’ve worked with even advocated for taking sorting off the database. I wasn’t entirely convinced by that one.
My server side language in this case was Scala, so it wasn’t slow, just memory hungry.