Php – In Search of Automatic ORM with REST interface

ormPHPrest

I have this wish that so far Google hasn't been able to fulfill. I want to find a package (ideally in PHP, because I know PHP, but I guess that's not a hard requirement) that you point at a database, it builds an ORM based on what it finds there, and exposes a REST interface over the web.

Everything I've found in my searches requires a bunch of code–like, it wants you to build the classes for it, but it'll handle the REST request routing. Or it does database and relational stuff just fine, but you have to build your own methods for all the CRUD actions.

That's dumb. REST is well defined. If I wanted to re-invent the wheel, I totally could, but I don't want to. Isn't there somebody who's built a one-shot super-simple auto-RESTing web service package?

Best Answer

As you say PHP is not a hard requirement, I hope it's okay to point to a Python solution: Django + django-tastypie will more or less do what you're asking for.

You can autogenerate the Django ORM classes from an existing database, and django-tastypie uses sensible defaults to expose each model using REST, only requiring a few lines of declaration for each ORM class you want to expose.