7 ms·
everytime I see something like this I question myself why I would want or need this over postgREST. I mean why reinvent the wheel? we live in a time where the
by omani 2y ago
everytime I see something like this I question myself why I would want or need this over postgREST.
I mean why reinvent the wheel? we live in a time where the DB itself is a REST API with postgREST.
https://postgrest.com https://postgrest.com
- satvikpendem 2y agoWhy would I want to interact with my database over the network when I can just...do it locally? It's orders of magnitudes slower and more wasteful and it doesn't even provide all the guarantees that using actual SQL or an ORM does.
- kccqzy 2y agoIf you are using PostgREST as intended, you don't have an application layer any more. It's not something extra you put in between the application and the database, but it replaces the application.
- satvikpendem 2y agoAh so it's like Hasura, it's a BaaS platform. Unfortunately I don't like putting all my logic in the client only.
- kccqzy 2y agoNo the logic is in the database. They encourage you to write functions to achieve custom logic in the database. Search for `create or replace function` in their tutorial to see an example.
- satvikpendem 2y agoYeah that is also something I don't want to do, after having used Hasura at a previous place. After a while, the logic gets convoluted when it's all in the database only.
- cryptonector 2y agoConvoluted how?
- cryptonector 2y agoIdk why you got downvoted. It's an excellent question. For those who don't know, with PostgREST you write all your application logic in SQL, and you export schemas (which are a subset of your actual schemas) with a RESTful API automatically generated by PostgREST. Meanwhile PostgREST is built on top of PostgreSQL, which is statically typed, and is written in Haskell, which is also statically typed.