Hacker News new | ask | show | jobs
by andyhoang 3379 days ago
What cases I should use this? I mean, look like it used for simple/beginning project, when ORM can do quite handy
3 comments

An ORM is a library integrated into a language runtime. Postgrest is a service – a separate process – which sits in front of a Postgres database, offering a RESTful HTTP API over that database. This means web or mobile HTTP clients can access the database in a safe, controlled manner.

Postgrest basically shifts the work of writing a basic CRUD API (a task for which you would probably use an ORM) to declaring a SQL schema. From that schema, it infers which endpoints should exist and what they should do. For a certain class of web app, this can be a HUGE time saver.

Beyond that, consider checking out the "Motivation" section of the website: https://postgrest.com/en/v0.4/intro.html

To be fair, you could do the same with an abstraction layer over an ORM.
I'm designing a web app that doesn't need much actual backend, save some static data slightly too large to ship with the static files. I have nginx serving static files and proxying db requests to postgrest.
What specific ORM do you have in mind when you write "handy?" I'd really like to know in case I've missed something.