News for hackers. Stuff that matters.
Re:Show HN: Quickly generate REST API (for Postgres db) by michaelmior on Monday September 09, 2019 @12:15PM (#20919500)
This is cool, although these days, (if requirements permit), my choice would be GraphQL via something like PostGraphile.

https://github.com/graphile/postgraphile

Re:Show HN: Quickly generate REST API (for Postgres db) by cpursley on Monday September 09, 2019 @01:41PM (#20920407)
https://github.com/PostgREST/postgrest (Haskell) is an order of magnitude more performant than postgraphile (Node ~ aka wet noodles).
Re:Show HN: Quickly generate REST API (for Postgres db) by BenjieGillam on Monday September 09, 2019 @02:50PM (#20921064)
I wouldn't let that sway you too much; the main reason for the performance difference is that PostgREST builds the JSON response in the database and then pipes that through to the user directly (at least that's my understanding). PostGraphile OTOH parses the JSON from the database and feeds it through the rest of your GraphQL schema, allowing data to be mixed in from your custom fields which might fetch from microservices or external services such as Stripe, or just perform additional calculations in application-land, and finally serialises the resulting data to send it to the end user. Despite this significantly greater flexibility and power requiring all this additional work, PostGraphile achieves very solid performance.
Re:Show HN: Quickly generate REST API (for Postgres db) by Dansvidania on Monday September 09, 2019 @03:47PM (#20921688)
came here to suggest the same thing :) I have been using this project and contributing to it recently and it is really great.

It has been months, and I keep discovering possibilities and functionality :)

Re:Show HN: Quickly generate REST API (for Postgres db) by sbr464 on Tuesday September 10, 2019 @09:18AM (#20927780)
Wet noodles?
Re:Show HN: Quickly generate REST API (for Postgres db) by o1lab on Tuesday September 10, 2019 @05:45AM (#20926526)
For those interested in creating REST APIs instantly on a mysql database

https://github.com/o1lab/xmysql/

Re:Show HN: Quickly generate REST API (for Postgres db) by appwiz on Monday September 09, 2019 @01:57PM (#20920571)
Mind if I ask the reason why you’d pick GraphQL as the default API technology?
Re:Show HN: Quickly generate REST API (for Postgres db) by gremlinsinc on Monday September 09, 2019 @04:12PM (#20921938)
I'd pick graphql ((I'm currently Using Hasura) because you can combine api's local and remote into one. You can also only ever worry about one endpoint and there are a lot of tools to create all the graphQL straight from the db : Postgraphile / Hasura are two that come to mind. Prisma is a little different but makes graphql easier.

Rest you have way more code to worry about, way more end points, you always have to figure which endpoint to send stuff too, and you usually have no control over how much data you're going to get back.. if you get back fifty fields, but only needed the email that's a lot of data that could interfere with performance.

Re:Show HN: Quickly generate REST API (for Postgres db) by appwiz on Monday September 09, 2019 @08:38PM (#20924072)
Yep, I’m familiar with the benefits of GraphQL (I built AWS AppSync and AWS Amplify). I’m interpreting from your response that the codegen and tooling for GraphQL saves a lot of time to create the usual API cruft and that’s why you prefer it. Is my understanding correct?
Re:Show HN: Quickly generate REST API (for Postgres db) by markhalonen on Monday September 09, 2019 @01:22PM (#20920154)
I've been using this tool on a project for a couple months. It's been fantastic, I spend all my time on the frontend!
Re:Show HN: Quickly generate REST API (for Postgres db) by alfonsodev on Monday September 09, 2019 @12:43PM (#20919777)
what are your thoughts about AWS AppSync ?
Re:Show HN: Quickly generate REST API (for Postgres db) by _c6yb on Monday September 09, 2019 @12:24PM (#20919585)
thanks for mentioning this library - looks great, I will have to try it out !
Re:Show HN: Quickly generate REST API (for Postgres db) by someguy1010 on Monday September 09, 2019 @12:31PM (#20919662)
this just saved me a bunch of time thanks!
Re:Show HN: Quickly generate REST API (for Postgres db) by gfodor on Monday September 09, 2019 @12:29PM (#20919637)
Re:Show HN: Quickly generate REST API (for Postgres db) by tga on Monday September 09, 2019 @12:36PM (#20919706)
Worth mentioning: http://hasura.io
Re:Show HN: Quickly generate REST API (for Postgres db) by bullen on Tuesday September 10, 2019 @06:38AM (#20926766)
Why don't you make the database use HTTP instead? http://root.rupy.se
Re:Show HN: Quickly generate REST API (for Postgres db) by skymoon01 on Tuesday September 10, 2019 @05:45AM (#20926528)
interesting topic