from Hacker News

Show HN: Xmysql – One command to serve REST APIs for any MySql database

by o1lab on 10/29/17, 7:29 PM with 49 comments

  • by dewey on 10/29/17, 10:17 PM

    Similar but with Go and for Postgres if you are looking for something like that. Used it in the past and works well for some quick prototyping: https://postgres.rest/
  • by oneweekwonder on 10/29/17, 10:28 PM

    Reminds of ArrestDB[0]. A one-file PHP "plug-n-play" RESTful API for SQLite, MySQL and PostgreSQL databases. ArrestDB provides a REST API that maps directly to your database stucture with no configuation.

    [0]: https://github.com/alixaxel/ArrestDB

  • by Karrot_Kream on 10/30/17, 12:19 AM

    Postgrest does the same thing for Postgres https://postgrest.com/
  • by setr on 10/30/17, 2:05 AM

    I don't get it; this doesn't seem to offer anything more than say, having a raw sql query in a post body, that gets thrown against the db. Except this looks a lot more annoying to write

    I'm imagining auth and permissions and such will still primarily be handled by the db in either case

  • by samspenc on 10/29/17, 10:35 PM

    One of the most amazing pieces of software I've worked with recently is Kibana, which is a web-based visualization software that is part of the open-source Elasticsearch stack.

    My understanding of why Kibana could be built and become such a powerful visualization tool is because of the easy-to-use and powerful REST APIs that Elasticsearch shipped with out of the box.

    Hopefully a REST API like this for MySQL will make it easy to build similar powerful tools around MySQL! It's definitely something that would have helped with the PHP / MySQL applications I built years ago.

  • by skhro87 on 10/30/17, 4:31 AM

  • by oneeyedpigeon on 10/30/17, 9:51 AM

    Is there a reason parameter names begin with underscore? Or why the page parameter is abbreviated to "p"? Why is a non-standard syntax used for multiple values rather than just parameter arrays? E.g. instead of:

    /api/payments?_fields=customerNumber,checkNumber

    why not:

    /api/payments?fields[]=customerNumber&fields[]=checkNumber

    Kudos for "sort=-{field}" though (I think); any commentary on that design choice? I've used e.g. "sortdir=desc" in the past; not sure which is superior.

  • by raja on 10/29/17, 10:15 PM

    pREST is something similar for postgres written in Go. (I haven't tried it) https://postgres.rest / https://github.com/prest/prest
  • by o1lab on 10/31/17, 5:59 PM

      xmysql now supports
      + group by
      + group by, order by
      + aggregate
      + single file upload, multiple file upload and download file
  • by tlack on 10/29/17, 10:05 PM

    I couldn't have used this many times over the years. Kudos
  • by onion-soup on 10/30/17, 11:03 AM

    How is this different from sending SQL to a remote MysQL server? It is literally wrapping existing interface with obscure query strings in URL
  • by stephenr on 10/30/17, 5:30 PM

    Ah, NodeJS. Where people write userland SQL clients with string substitution and call it "prepared queries".
  • by treve on 10/29/17, 10:19 PM

    It's not really REST if there's no link in sight. Why not just call it a HTTP API or a Webservice?
  • by softwarelimits on 10/30/17, 9:10 AM

    no permission system?