8 ms·
Previously discussed: 7 years ago: https://news.ycombinator.com/item?id=9927771 https://news.ycombinator.com/item?id=9927771 3 years ago: https://news.ycombina
by PreInternet01 4y ago
Previously discussed:
7 years ago: https://news.ycombinator.com/item?id=9927771 https://news.ycombinator.com/item?id=9927771
3 years ago: https://news.ycombinator.com/item?id=21435195 https://news.ycombinator.com/item?id=21435195
2 years ago: https://news.ycombinator.com/item?id=25159097 https://news.ycombinator.com/item?id=25159097
1 year ago: https://news.ycombinator.com/item?id=29389576 https://news.ycombinator.com/item?id=29389576
It's an insanely cool project, but I've yet to find a truly fitting use case for it. In theory, PostgREST combined with something like https://marmelab.com/react-admin/ https://marmelab.com/react-admin/ should give you a free back-end and admin panel for most projects, but in practice, I've always found that all kinds of 'small details' won't be quite right out of the box, and that customization is really hard...
- tomberek 4y agoI’ve used Prest (the Go reimplementation of PostgREST) because I could more easily customize or bring it in as a library in a larger application.
- gregwebs 4y agohow do you customize it and use it as a library? Using it as a framework is deprecated now? I didn't see docs talking about this.
- tomberek 4y agoPretty sure I started with this: https://github.com/prest/prest/blob/main/cmd/root.go https://github.com/prest/prest/blob/main/cmd/root.go And from there you can execute your own command and add handlers or other things as you wish.
- euroderf 4y agoI wonder if there's an SQLite version somewhere.
- __oh_es 4y agoMore feature rich but perhaps this? Been dying to toy with this and fslite https://github.com/pocketbase/pocketbase https://github.com/pocketbase/pocketbase
- xrd 4y agoAbsolutely love pocketbase. And, interesting to note that using triggers within pocketbase isn't well supported because they do a dry run insert to check against constraints and then delete it if the constraint fails. https://github.com/pocketbase/pocketbase/discussions/650#discussioncomment-3744699 https://github.com/pocketbase/pocketbase/discussions/650#dis... I mention this because the OP inquired about stored procedures, somewhat related. Still, pocketbase is so amazing.
- jhd3 4y agohttps://datasette.io/ https://datasette.io/?
- euroderf 4y agoThanks to these comments I've taken a deeper look at both Pocketbase and Datasette. I wonder, could I use replication to keep the DB of Datasette (operating in read-only mode) in sync with the DB of Pocketbase.
- IceWreck 4y agoIs supabase what you're describing? I could be wrong but I think they use postgREST underneath.
- the_duke 4y agoYes, it definitely does.
- esquire_900 4y agoI've always wondered about this without trying it myself. Isn't this be something that looks ideal to start with, but as the project progresses and the edge cases keep stacking, you end up writing a complete middle layer, which effectively turns out to be your own framework?
- CuriouslyC 4y agoMost of the edge cases can be handled using stored procedures on the database, which can be called in PostgREST using a generic '/rpc/<name>' endpoint. You can use foreign data wrappers to handle almost all the remaining edge cases, though that has diminishing returns in terms of time savings vs having a separate service as cases increase in complexity.
- pvillano 4y agoComplexity is often unavoidable. The question is where do you put it?
- lelanthran 4y ago> Most of the edge cases can be handled using stored procedures on the database, This is what actually turned my off about it when I used it for a small hobby project: the tooling around programming in SQL is absolute crap. Expressing business logic in stored procedures is great in theory, but in practice only the very simplest business logic will be written as stored procedures, because anything non-trivial is impossible to debug, impossible to log properly and there is never a call-stack available when the inevitable runtime error/exception occurs. If the tooling for writing, debugging, deploying and testing stored procedures were up to the level of what Turbo Pascal was in the 80s, I'd do it in a heartbeat. As things stand, the only way to figure out bugs in the system is to visually inspect the stored procedure source code.
- xupybd 4y agoI've seen a very complex payroll written in stored procedures. You're right about debugging, it's horrible. Once you get good at it there is an elegance to the solution but refactoring sux. Then there is performance tuning. You can get things so fast because you don't have to fetch from the db, you're already at the data source. You can also get things so slow as your loaded up on complex queries.
- dang 4y agoThanks! Macroexpanded: Building single-page-apps with PostgREST - https://news.ycombinator.com/item?id=30132947 https://news.ycombinator.com/item?id=30132947 - Jan 2022 (84 comments) PostgREST 9.0 - https://news.ycombinator.com/item?id=29389576 https://news.ycombinator.com/item?id=29389576 - Nov 2021 (121 comments) PostgREST: REST API for any Postgres database - https://news.ycombinator.com/item?id=25159097 https://news.ycombinator.com/item?id=25159097 - Nov 2020 (205 comments) PostgREST - https://news.ycombinator.com/item?id=21435195 https://news.ycombinator.com/item?id=21435195 - Nov 2019 (237 comments) PostgREST – A fully RESTful API from any existing PostgreSQL database - https://news.ycombinator.com/item?id=13959156 https://news.ycombinator.com/item?id=13959156 - March 2017 (87 comments) PostgREST – REST API from any PostgreSQL database - https://news.ycombinator.com/item?id=9927771 https://news.ycombinator.com/item?id=9927771 - July 2015 (204 comments) Automatic REST API for Any Postgres Database - https://news.ycombinator.com/item?id=8831960 https://news.ycombinator.com/item?id=8831960 - Jan 2015 (68 comments)