(no title)
mnd999
|
2 years ago
The only postgREST app I ever worked on was awful. Why? Because like most of these ‘simple’ frameworks it’s only simple until your requirements get complicated. Then the original authors had to resort to writing a ton of stored procedures on the database to get back the results they wanted and that led to scalability problems. The solution, as always, is go back to SQL.
DevX101|2 years ago
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.
mnd999|2 years ago
j-a-a-p|2 years ago
Already PostGREST is getting complicated, additions like this will make it less attractive to me.
steve-chavez|2 years ago
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...
cpursley|2 years ago
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.
Octabrain|2 years ago
mnd999|2 years ago
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.