3 ms·
What's the use case for something like this? The claim that it writes APIs better than I could by hand doesn't make a lot of sense to me--writing an API-ORM-thi
by ezekg 10y ago
What's the use case for something like this? The claim that it writes APIs better than I could by hand doesn't make a lot of sense to me--writing an API-ORM-thing, sure, but not a non-trivial API. I've never built an API that is simply a CRUD front-end to a database--there's always business logic + the output of the API very rarely matches the database tables underneath e.g. you may be rendering 2-3 different models, but that's never revealed to the end-user.
- ruslan_talpa 10y agoDon't confuse PostgREST with something that you just point at a (poorly designed) database schema and magic happens and you get a nice api. You point it to a schema that consist only of views (that you define) and stored procedures (that you write) that abstract away the underlying tables. You define constraints on all your columns so junk does not get into the db. You define database roles and RLS policies and give them privileges so that you control who has access to what. You still in a way write backend code, but in this case backend code is mostly views/constraints/triggers and in rare cases stored procedures.
- ezekg 10y agoI see. Either way, that's not really obvious from the readme or the tagline, "REST API from any existing PostgreSQL database."